# Vanilla Client Source: https://docs.corsair.dev/adapters/client createCorsairClient is a typed fetch wrapper for the management API. No React, no framework — types only. `createCorsairClient({ baseURL })` returns a typed client that mirrors every route on the [handler](/management/handler). Use it from a Node script, a CLI, a worker, or a non-React frontend. ```ts client.ts theme={null} import { createCorsairClient } from "corsair"; const client = createCorsairClient({ baseURL: "/api/corsair" }); ``` For React, prefer [`createCorsairReactClient`](/adapters/react) — it wraps this one and adds hooks. ## Reading ```ts reads.ts theme={null} await client.tenants.list(); // GET /tenants await client.tenants.get("acme"); // GET /tenants/acme await client.plugins.list(); // GET /plugins await client.plugins.get("github"); // GET /plugins/github await client.connectionStatus.get({ // GET /connection-status tenantId: "acme", }); await client.permissions.get({ id: "perm_123" }); // GET /permissions/perm_123 await client.permissions.get({ token: "tok_abc" }); // POST /permissions/lookup-by-token await client.ok(); // GET /ok ``` Every method is typed against the route's response. Hovering `client.tenants.list()` in your editor shows `Promise`, and so on. `connectionStatus.get` returns a `Record` keyed by plugin id: ```ts theme={null} const status = await client.connectionStatus.get({ tenantId: "acme" }); // { github: 'connected', slack: 'not_connected', notion: 'missing_credentials' } ``` ## Writing ```ts writes.ts theme={null} await client.tenants.create({ id: "acme" }); // POST /tenants ``` Connect/OAuth methods are documented on the [Connect page](/management/connect). ## Options ```ts theme={null} createCorsairClient({ baseURL: "/api/corsair", // required fetch: customFetch, // optional — override globalThis.fetch }); ``` `baseURL` is the origin + base path the handler is mounted at, e.g. `https://app.example.com/api/corsair`. A trailing slash is tolerated. `fetch` is optional — see [Custom fetch](#custom-fetch) below. Need auth headers, custom retry, or interceptors? Pass a wrapped `fetch`: ```ts theme={null} const client = createCorsairClient({ baseURL: "/api/corsair", fetch: (input, init) => globalThis.fetch(input, { ...init, headers: { ...init?.headers, Authorization: `Bearer ${token()}` }, }), }); ``` ## Error handling Failed requests throw `CorsairClientError`: ```ts theme={null} import { CorsairClientError } from "corsair"; try { await client.tenants.get("does-not-exist"); } catch (err) { if (err instanceof CorsairClientError) { err.status; // number — HTTP status err.code; // string — e.g. "not_found" err.message; // string — human message from the server err.extra; // Record — any additional fields the server returned } } ``` Network failures (DNS, abort, no response) throw a plain `Error` — `CorsairClientError` is only used when the server responded with a non-2xx body. ## Custom fetch When you call `createCorsairClient`, the client picks its `fetch` function once — either the one you pass in, or `globalThis.fetch` at that moment. Every later call (`client.tenants.list()`, etc.) uses that same function; it does not re-read `globalThis.fetch` on each request. In a normal browser or Node 18+ app, this makes no practical difference. `fetch` is already available when you create the client, and it stays the same. It only matters in two cases: * **Tests** — your test runner or jsdom may install or replace `fetch` after your client module is imported. Pass an explicit `fetch` so the client uses the right one. * **Custom behavior** — auth headers, retries, or routing requests to an in-process handler instead of over HTTP. ```ts theme={null} // Test: wire the client directly to the handler, no TCP socket const handler = managementHandler(corsair); const client = createCorsairClient({ baseURL: "http://test.local/api/corsair", fetch: (input, init) => handler(new Request(String(input), init)), }); ``` If you create the client at module scope and later replace `globalThis.fetch`, the client will not pick up the change. Create the client after your environment is ready, or pass `fetch` explicitly. # Frameworks Source: https://docs.corsair.dev/adapters/handlers Mount the Corsair /api/corsair route on your framework — Next.js, Express, Hono, or any Web-standard runtime. Corsair mounts **one** route. It serves Hub delivery — OAuth callbacks, connect pages, self-registration — and the [management API](/management/handler) in the same place. Every adapter wraps a single primitive, `managementHandler(corsair)`, which returns a `(request: Request) => Promise`. Pick the tab for your server; the rest of your app is identical. ## Configure Corsair ```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_DEV_API_KEY!, signingSecret: process.env.CORSAIR_DEV_SIGNING_SECRET!, }, }); ``` ## Mount the route ```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', }); ``` Pages Router? Export a catch-all API route at `pages/api/corsair/[...path].ts` and forward `req`/`res` through the same `toNextJsHandler`. The App Router is the supported default. ```ts server.ts theme={null} import express from 'express'; import { toExpressHandler } from 'corsair'; import { corsair } from './corsair'; const app = express(); // Required: Hub delivers results as JSON POSTs. The adapter reads the parsed // body, so express.json() must run before the Corsair route. app.use(express.json()); app.use('/api/corsair', toExpressHandler(corsair, { basePath: '/api/corsair' })); app.listen(3000); ``` Mount `express.json()` **before** the Corsair route. Without it, `req.body` is undefined and Hub's delivery POSTs arrive empty — connects will look like they hang. ```ts index.ts theme={null} import { Hono } from 'hono'; import { toHonoHandler } from 'corsair'; import { corsair } from './corsair'; const app = new Hono(); // Wildcard: Corsair routes several paths under the base (delivery, connect, // tenants). Match them all with `/*`, and keep basePath in sync with the mount. app.all('/api/corsair/*', toHonoHandler(corsair, { basePath: '/api/corsair' })); export default app; ``` Every adapter wraps one primitive: `managementHandler(corsair)` returns `(request: Request) => Promise`. Any framework whose routes speak the Fetch API calls it directly — no adapter needed. ```ts SvelteKit theme={null} // src/routes/api/corsair/[...path]/+server.ts import { managementHandler } from 'corsair'; import { corsair } from '$lib/server/corsair'; const handler = managementHandler(corsair, { basePath: '/api/corsair' }); export const GET = ({ request }) => handler(request); export const POST = ({ request }) => handler(request); ``` ```ts Remix theme={null} // app/routes/api.corsair.$.ts import { managementHandler } from 'corsair'; import { corsair } from '~/server/corsair'; const handler = managementHandler(corsair, { basePath: '/api/corsair' }); export const loader = ({ request }) => handler(request); export const action = ({ request }) => handler(request); ``` ```ts Astro theme={null} // src/pages/api/corsair/[...path].ts import { managementHandler } from 'corsair'; import { corsair } from '../../../server/corsair'; const handler = managementHandler(corsair, { basePath: '/api/corsair' }); export const GET = ({ request }) => handler(request); export const POST = ({ request }) => handler(request); export const prerender = false; ``` ```ts Nuxt theme={null} // server/routes/api/corsair/[...path].ts import { fromWebHandler } from 'h3'; import { managementHandler } from 'corsair'; import { corsair } from '~/server/corsair'; // h3's fromWebHandler adapts the (Request) => Response handler to Nitro. export default fromWebHandler( managementHandler(corsair, { basePath: '/api/corsair' }), ); ``` ```ts Workers / Bun / Deno theme={null} import { managementHandler } from 'corsair'; import { corsair } from './corsair'; const handler = managementHandler(corsair, { basePath: '/api/corsair' }); export default { fetch: (request: Request) => handler(request) }; ``` Backend not in JavaScript? Corsair's SDK is TypeScript-only. Integrate over the [Hub REST API](/hub/rest-api) instead. ## Run and go green Start your dev server and make one request to `/api/corsair`. On that first request your app self-registers its delivery URL with Hub and the dashboard header dot turns green. See [Delivery URLs](/hub/delivery-urls). Stays grey? The route isn't reachable at `/api/corsair`. Check the mount path and — on Express and Hono — that `basePath` and the wildcard (`/api/corsair/*`) match the path you mounted. ## What's next Create a project, copy keys, reach the green check. Browse the catalog — GitHub, Slack, Linear, and hundreds more. Call the management API from any JS runtime. Typed `useTenants`, `useConnectionStatus`, and friends. # React Hooks Source: https://docs.corsair.dev/adapters/react createCorsairReactClient returns typed React hooks over the management API — useTenants, useConnectionStatus, useOAuthCallback, and friends. `createCorsairReactClient({ baseURL })` returns a bag of typed React hooks built on top of [`createCorsairClient`](/adapters/client). One factory call per app — use the returned hooks anywhere in your component tree. ```tsx corsair-client.ts theme={null} "use client"; import { createCorsairReactClient } from "corsair/client/react"; export const { useTenants, useTenant, useCreateTenant, usePlugins, usePlugin, useConnectionStatus, usePermission, useCreateConnectLink, useOAuthCallback, client, // escape hatch — the underlying vanilla client } = createCorsairReactClient({ baseURL: "/api/corsair" }); ``` React 18+ is a peer dependency. If you aren't on React, use the [vanilla client](/adapters/client). ## Read hooks Read hooks follow the same shape: ```tsx tenants-list.tsx theme={null} const { data, loading, error, refetch } = useTenants(); ``` | Field | Type | Notes | | --------- | ----------------------------- | ----------------------------------- | | `data` | the typed response, or `null` | populated on success | | `loading` | `boolean` | `true` while a request is in flight | | `error` | `Error \| null` | typed error if the call failed | | `refetch` | `() => Promise` | manual re-trigger | Read hooks re-fetch automatically when their argument changes: ```tsx tenant-detail.tsx theme={null} function TenantDetail({ id }: { id: string }) { const { data, loading } = useTenant(id); // changing `id` triggers a fresh fetch automatically if (loading) return ; return
{JSON.stringify(data, null, 2)}
; } ``` Available read hooks: `useTenants`, `useTenant(id)`, `usePlugins`, `usePlugin(id)`, `useConnectionStatus({ tenantId })`, `usePermission({ id })` or `usePermission({ token })`. ## Mutation hooks Mutations stay idle until you call `mutate(input)`: ```tsx create-tenant.tsx theme={null} function CreateTenant() { const { mutate, loading, error, data } = useCreateTenant(); return (
{ e.preventDefault(); const id = new FormData(e.currentTarget).get("id") as string; await mutate({ id }); }}> {error &&

{error.message}

} {data &&

Created {data.id}

}
); } ``` Available mutation hooks: `useCreateTenant`, `useCreateConnectLink`, `useOAuthCallback`. ## Connection status `useConnectionStatus` is the hook your dashboard probably opens with. The response is a `Record` keyed by plugin id: ```tsx connections.tsx theme={null} function Connections({ tenantId }: { tenantId: string }) { const { data } = useConnectionStatus({ tenantId }); if (!data) return null; return (
    {Object.entries(data).map(([plugin, status]) => (
  • {plugin}: {status === "connected" ? "✓" : "Connect →"}
  • ))}
); } ``` For wiring the actual connect-and-authorize flow, see the [Connect page](/management/connect). ## Escape hatch If a hook doesn't fit (e.g. you need imperative access inside an event handler), reach for `client`: ```tsx escape.tsx theme={null} const handleClick = async () => { const tenant = await client.tenants.create({ id: "acme" }); console.log(tenant); }; ``` It is exactly the [vanilla client](/adapters/client), sharing the same `baseURL`. ## What this is not These hooks are intentionally minimal: no cache, no deduplication, no request reuse. If you want React Query, SWR, or RTK semantics, build them on top of `client` — the hooks here exist to give you typed loading/error/data state without forcing a data-layer choice. # API Source: https://docs.corsair.dev/concepts/api Corsair API. When you create a Corsair instance, every plugin exposes its API endpoints through a nested, intuitive structure. Each plugin's API is accessible directly on the Corsair instance. ```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 — 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); }, }, }, }, }) ``` # API Key Authentication Source: https://docs.corsair.dev/concepts/api-key Use static API keys and tokens with Corsair plugins. API key authentication is the simplest auth type in Corsair. You provide a static credential — an API key, personal access token, or bot token — and Corsair stores it encrypted in your database, then injects it into every request automatically. ## How it works Corsair stores your key using [envelope encryption](https://docs.cloud.google.com/kms/docs/envelope-encryption). Your KEK encrypts a per-connection DEK, which encrypts the key itself. The key is never stored in plaintext. ```ts corsair.ts theme={null} import { createCorsair } from "corsair"; import { linear } from "@corsair-dev/linear"; export const corsair = createCorsair({ plugins: [linear()], kek: process.env.CORSAIR_KEK!, }); ``` Store your key once with the CLI: ```bash theme={null} pnpm corsair setup --plugin=linear api_key=your-api-key ``` Every `corsair.linear.api.*` call will use the stored key automatically. *** ## Solo setup Solo mode means one API key shared across your entire application. This is the default — no extra configuration needed. ```ts corsair.ts theme={null} export const corsair = createCorsair({ plugins: [ linear({ authType: "api_key" }), ], kek: process.env.CORSAIR_KEK!, }); ``` Store the key: ```bash theme={null} pnpm corsair setup --plugin=linear api_key=lin_api_your-key-here ``` All API calls use this key: ```ts usage.ts theme={null} const issues = await corsair.linear.api.issues.list({ teamId: "team-id" }); ``` *** ## Multi-tenant setup In multi-tenant mode, each user supplies their own API key. Keys are stored and encrypted separately per tenant. ```ts corsair.ts theme={null} export const corsair = createCorsair({ multiTenancy: true, plugins: [linear()], kek: process.env.CORSAIR_KEK!, }); ``` Store each tenant's key — for example, after collecting it during onboarding: ```ts onboarding.ts theme={null} await corsair .withTenant("user_abc123") .linear.keys.set_api_key("lin_api_their-key"); ``` Or via the CLI during development: ```bash theme={null} pnpm corsair setup --plugin=linear api_key=lin_api_tenant_key --tenant=user_abc123 ``` Use `withTenant` to scope all API calls to a specific user: ```ts usage.ts theme={null} const tenant = corsair.withTenant("user_abc123"); // Uses user_abc123's stored key — not your app's key const issues = await tenant.linear.api.issues.list({ teamId: "team-id" }); ``` Each tenant's key is independently encrypted. Compromising one does not expose others. *** ## Bring Your Own Key If you manage your own decryption (e.g., AWS KMS or Google Cloud KMS), pass the decrypted key directly instead of using database storage: ```ts corsair.ts theme={null} linear({ key: await kms.decrypt(encryptedKey), }) ``` See [Authentication](/concepts/auth#bring-your-own-kms) for details. # Authentication Source: https://docs.corsair.dev/concepts/auth OAuth, API keys, and bot tokens — handled automatically. Corsair handles authentication for production-grade applications. Whether you need OAuth flows, API keys, or bot tokens, Corsair manages credentials across all your tenants. ```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, plugins: [ slack({ authType: "api_key", credentials: { botToken: "xoxb-..." }, }), linear({ authType: "oauth_2", credentials: { clientId: process.env.LINEAR_CLIENT_ID, clientSecret: process.env.LINEAR_CLIENT_SECRET, }, }), ], }); ``` ## Auth Types Choose the auth type for each integration: ### API Key For integrations that use static API keys or bot tokens. ```ts theme={null} slack({ authType: "api_key", credentials: { botToken: "xoxb-your-bot-token" }, }) ``` ### OAuth 2.0 For integrations that require user authorization. ```ts theme={null} linear({ authType: "oauth_2", credentials: { clientId: process.env.LINEAR_CLIENT_ID, clientSecret: process.env.LINEAR_CLIENT_SECRET, }, }) ``` ## 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. 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 credentials. Encrypted tokens are persisted only in your database in both modes. ## Bring Your Own KMS If you're using a Key Management Service (AWS KMS, Google Cloud KMS, etc.), you can opt out of Corsair's built-in encryption. ```ts corsair.ts theme={null} export const corsair = createCorsair({ plugins: [ slack({ authType: "api_key", credentials: { // Pass your decrypted key directly botToken: await kms.decrypt(encryptedToken), }, }), ], }); ``` ## 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 Four 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](/getting-started/quick-start) for a full setup example. 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 ``` 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 ``` ```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) ); ``` ```bash theme={null} sqlite3 corsair.db < migration.sql ``` ```powershell theme={null} Get-Content migration.sql | sqlite3 corsair.db ``` ```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 ); ``` ```bash theme={null} psql $DATABASE_URL -f migration.sql ``` ```powershell theme={null} psql $env:DATABASE_URL -f migration.sql ``` ```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'), }); ``` Then push the schema to your database: ```bash theme={null} npx drizzle-kit push ``` ```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") } ``` 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 Four tables for every integration — Slack, GitHub, Linear, and the rest all share the same schema. | 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 — messages, channels, issues, repos (`entity_id`, `entity_type`, `data`) | | `corsair_events` | Audit log of API calls and webhooks | ```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` — it works alongside whatever ORM you already use for your own tables. 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!, }); ``` 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!, }); ``` Define the four 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 Scope credentials and data per user with `withTenant()`. How incoming events update your rows automatically. Call third-party APIs with full type safety. # Error Handling Source: https://docs.corsair.dev/concepts/error-handling Graceful error handling with intelligent retry strategies. Corsair catches all API errors and routes them through a hierarchical error handling system. You can define handlers at multiple levels, and Corsair will use the most specific one available. ```ts corsair.ts theme={null} import { createCorsair } from "corsair"; import { slack } from "@corsair-dev/slack"; export const corsair = createCorsair({ plugins: [ slack({ authType: "api_key", credentials: { botToken: "xoxb-..." }, errorHandlers: { RATE_LIMIT_ERROR: { match: (error) => error.message.includes("rate_limited"), handler: async (error, context) => ({ maxRetries: 5, retryStrategy: "exponential_backoff_jitter", }), }, }, }), ], }); ``` ## Error Handler Hierarchy Corsair checks for error handlers in this order: 1. **Plugin-specific error** — e.g., Slack rate limit handler 2. **Root-level error** — e.g., global rate limit handler for all integrations 3. **Plugin default** — e.g., default Slack error handler 4. **Root default** — default handler for all integrations 5. **Corsair fallback** — built-in handler that fails gracefully This means you only need to define handlers for the cases you care about. ## Plugin-Level Handler Handle errors specific to a single integration. ```ts corsair.ts theme={null} slack({ authType: "api_key", credentials: { botToken: "xoxb-..." }, errorHandlers: { RATE_LIMIT_ERROR: { match: (error) => error.message.includes("rate_limited"), handler: async (error, context) => { console.log(`Slack rate limited on ${context.operation}`); return { maxRetries: 3, retryStrategy: "exponential_backoff_jitter", }; }, }, }, }) ``` ## Root-Level Handler Handle errors across all integrations. ```ts corsair.ts theme={null} export const corsair = createCorsair({ plugins: [slack({ ... }), linear({ ... })], errorHandlers: { RATE_LIMIT_ERROR: { match: (error) => { const msg = error.message.toLowerCase(); return msg.includes("rate_limited") || msg.includes("429"); }, handler: async (error, context) => { console.log(`Rate limit on ${context.operation}`); return { maxRetries: 5 }; }, }, }, }); ``` ## Default Handler Catch any error that doesn't match a specific handler. ```ts corsair.ts theme={null} slack({ authType: "api_key", credentials: { botToken: "xoxb-..." }, errorHandlers: { DEFAULT: { match: () => true, handler: async (error, context) => { console.error(`Unhandled error: ${error.message}`); return { maxRetries: 0 }; }, }, }, }) ``` ## No Handler Needed You don't have to define any error handlers. Corsair provides sensible defaults that ensure your application fails gracefully. Start simple and add handlers as needed. ```ts corsair.ts theme={null} // This works fine — Corsair handles errors gracefully by default export const corsair = createCorsair({ plugins: [slack({ authType: "api_key", credentials: { botToken: "xoxb-..." } })], }); ``` ## Retry Strategies When returning from an error handler, you can specify: * `maxRetries` — number of retry attempts * `retryStrategy` — `"exponential_backoff_jitter"` or other strategies ```ts theme={null} handler: async (error, context) => ({ maxRetries: 5, retryStrategy: "exponential_backoff_jitter", }) ``` # 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 — logging, validation, 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 → operation 2. The **operation** executes 3. **After hooks** run in order: operation → 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 four tables, no matter how many integrations you have. ```ts theme={null} plugins: [ slack({ ... }), linear({ ... }), github({ ... }), gmail({ ... }), // 100 more integrations — still just 4 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 — database ID, auth provider ID, anything: ```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.findAll(); // 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 How to scope incoming events per tenant using the ?tenantId= param. Scaffold a Next.js app that uses Corsair with multi-tenancy. # OAuth 2.0 Authentication Source: https://docs.corsair.dev/concepts/oauth Connect user accounts with OAuth 2.0 flows in Corsair plugins. OAuth 2.0 lets users authorize your application to act on their behalf. Corsair handles the entire flow — minting connect links, processing callbacks, storing tokens encrypted, and refreshing them automatically when they expire. ## How it works 1. You register an OAuth app with the service and get a `client_id` and `client_secret` 2. Your app calls `client.connect.createLink()` and redirects the user to the returned URL 3. After the user approves, the service redirects back with an authorization code 4. Corsair exchanges the code for access and refresh tokens and stores them encrypted 5. On every API call, Corsair checks token expiry and refreshes automatically Corsair supports two connect modes — **`hub`** (Corsair hosts the UI) or **`manual`** (you host connect pages). Both use the same `createLink` API. See [Connect / OAuth](/management/connect) for the full reference. ```ts corsair.ts theme={null} import { createCorsair } from "corsair"; import { gmail } from "@corsair-dev/gmail"; export const corsair = createCorsair({ plugins: [gmail({ authType: "oauth_2" })], kek: process.env.CORSAIR_KEK!, database: db, }); ``` *** ## Solo setup Solo mode connects a single account to your application. Use this for scripts, internal tools, or apps that only ever connect one account. ```ts corsair.ts theme={null} export const corsair = createCorsair({ plugins: [gmail({ authType: "oauth_2" })], kek: process.env.CORSAIR_KEK!, database: db, }); ``` Store your OAuth app credentials, then start the flow: ```bash theme={null} pnpm corsair setup --plugin=gmail client_id=your-client-id client_secret=your-client-secret pnpm corsair auth --plugin=gmail ``` The CLI prints an authorization URL. Open it in a browser, approve, and tokens are stored automatically. After that, all API calls use your connected account: ```ts usage.ts theme={null} const messages = await corsair.gmail.api.messages.list({ maxResults: 10 }); ``` Tokens are refreshed automatically when they expire — no intervention needed. *** ## Multi-tenant setup In multi-tenant mode, each user connects their own account. Configure **manual** connect mode and mount the [management handler](/management/handler). ```ts corsair.ts theme={null} export const corsair = createCorsair({ multiTenancy: true, plugins: [gmail({ authType: "oauth_2" })], kek: process.env.CORSAIR_KEK!, database: db, manual: { baseUrl: `${process.env.APP_URL}/connect`, redirectUri: `${process.env.APP_URL}/api/oauth/callback`, }, }); ``` ```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", }); ``` ### 1. Store your OAuth app credentials Store your client credentials once — these are shared across all tenants: ```bash theme={null} pnpm corsair setup --plugin=gmail client_id=your-client-id client_secret=your-client-secret ``` ### 2. Create a connect link When a user wants to connect, mint a link from your authenticated backend and redirect them: ```ts app/actions/connect.ts theme={null} "use server"; import { corsair } from "@/server/corsair"; import { getSessionTenantId } from "@/server/auth"; export async function startOAuthConnect(plugin: string) { const tenantId = await getSessionTenantId(); if (!tenantId) throw new Error("Unauthorized"); const { connectUrl } = await corsair.manage.connect.createLink({ plugin, tenantId, }); return connectUrl; } ``` Or from the client via the [management client](/adapters/client): ```tsx connect-button.tsx theme={null} "use client"; import { createCorsairReactClient } from "corsair/client/react"; const { useCreateConnectLink } = createCorsairReactClient({ baseURL: "/api/corsair", }); function ConnectGmail({ tenantId }: { tenantId: string }) { const { mutate, loading } = useCreateConnectLink(); return ( ); } ``` The signed `state` is embedded in `connectUrl` — you do not store it separately. ### 3. Resolve on your connect page The user lands on `/connect?state=…`. Resolve the state and redirect to the provider: ```ts app/connect/page.tsx theme={null} import { redirect } from "next/navigation"; import { corsair } from "@/server/corsair"; export default async function ConnectPage({ searchParams, }: { searchParams: Promise<{ state?: string }>; }) { const { state } = await searchParams; if (!state) return

Missing state.

; const { oauthUrl } = await corsair.manage.connect.resolve(state); redirect(oauthUrl); } ``` ### 4. Handle the callback After the user approves, the provider redirects to your callback URL: ```ts app/api/oauth/callback/route.ts theme={null} import { corsair } from "@/server/corsair"; import type { NextRequest } from "next/server"; import { NextResponse } from "next/server"; export async function GET(request: NextRequest) { const { searchParams } = new URL(request.url); const code = searchParams.get("code"); const state = searchParams.get("state"); if (!code || !state) { return new NextResponse("Missing code or state.", { status: 400 }); } const result = await corsair.manage.connect.oauthCallback({ code, state }); return NextResponse.redirect( `/dashboard?connected=${encodeURIComponent(result.plugin)}`, ); } ``` Corsair extracts the `tenantId` from the HMAC-signed state, exchanges the code for tokens, and stores them encrypted for that tenant. See [Production: OAuth Process](/concepts/oauth-process) for a full implementation with security best practices — authenticated link creation, HTML escaping, and production checklists. ### 5. Make API calls per tenant ```ts usage.ts theme={null} const tenant = corsair.withTenant("user_abc123"); // Uses user_abc123's connected account const messages = await tenant.gmail.api.messages.list({ maxResults: 10 }); ``` ### Hub mode alternative If you don't want to build connect pages, use `hub: { ... }` instead of `manual`. Call the same `createLink` API — the URL points to Corsair Hub's hosted UI. Hub hosts the connect surfaces and stores none of your credentials. See [Hub overview](/hub/overview) for the model and [Connect / OAuth](/management/connect#hub-mode-hosted-connect-ui) for the API. *** ## Automatic token refresh OAuth access tokens expire (typically after 1 hour). Corsair checks token expiry before every API call and refreshes automatically using the stored refresh token. Your code never needs to handle token expiry. See [Authentication](/concepts/auth#automatic-token-refresh) for more details. # OAuth Process Source: https://docs.corsair.dev/concepts/oauth-process A production-ready OAuth implementation with security best practices for Corsair. OAuth lets your users connect their own accounts to your app. Corsair handles state signing, token exchange, and encrypted storage — you wire up the connect flow. Corsair supports two connect modes: | Mode | Config | What you build | | ---------- | ---------------------------------- | --------------------------------------------------------------------------------- | | **Hub** | `hub: { ... }` | Mint a link, redirect to Corsair Hub — see [Connect / OAuth](/management/connect) | | **Manual** | `manual: { baseUrl, redirectUri }` | Connect page + OAuth callback (this guide) | This page covers **manual mode** in production. The flow uses `client.connect.createLink()` — one API for minting connect URLs. ```mermaid theme={null} sequenceDiagram actor User participant App as Your App participant Connect as /connect page participant Provider as OAuth Provider User->>App: Click "Connect" App->>App: createLink (authenticated) App->>User: Redirect to connectUrl User->>Connect: Land with ?state= Connect->>Provider: Redirect to OAuth URL User->>Provider: Approve access Provider->>App: Redirect to callback with code App->>App: oauthCallback App->>User: Connected! ``` Corsair handles CSRF protection via HMAC-signed state, token encryption, and automatic refresh before API calls. *** ## Configure your app Add OAuth plugins, `database`, `kek`, and **manual** connect config. Mount the [management handler](/management/handler) so `createLink` is available over HTTP. ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { gmail } from '@corsair-dev/gmail'; export const corsair = createCorsair({ plugins: [gmail()], kek: process.env.CORSAIR_KEK!, database: db, manual: { baseUrl: `${process.env.APP_URL}/connect`, redirectUri: `${process.env.APP_URL}/api/oauth/callback`, }, }); ``` ```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', }); ``` Store your OAuth app credentials once: ```bash theme={null} pnpm corsair setup --plugin=gmail client_id=YOUR_CLIENT_ID client_secret=YOUR_CLIENT_SECRET ``` OAuth is supported by plugins like Gmail, Google Calendar, Notion, Spotify, Dropbox, and others. ## Create the connect link When a user clicks "Connect", call `createLink` on your **authenticated** backend. Read `tenantId` from your session — never from the request body alone in production. **This step must be authenticated.** If left open, anyone could mint connect links for arbitrary tenants. Always resolve `tenantId` from your session before calling `createLink`. ```ts app/actions/connect.ts theme={null} 'use server'; import { corsair } from '@/server/corsair'; import { getSessionTenantId } from '@/server/auth'; export async function createConnectLink(plugin: string) { const tenantId = await getSessionTenantId(); if (!tenantId) throw new Error('Unauthorized'); return corsair.manage.connect.createLink({ plugin, tenantId }); } ``` ```tsx connect-button.tsx theme={null} 'use client'; import { createConnectLink } from '@/app/actions/connect'; export function ConnectGmail() { return ( ); } ``` ```ts app/api/corsair/connect/links/route.ts theme={null} import { NextResponse } from 'next/server'; import { corsair } from '@/server/corsair'; import { getSessionTenantId } from '@/server/auth'; export async function POST(request: Request) { const tenantId = await getSessionTenantId(request); if (!tenantId) { return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }); } const { plugin } = (await request.json()) as { plugin?: string }; if (!plugin) { return NextResponse.json({ error: 'plugin is required' }, { status: 400 }); } const link = await corsair.manage.connect.createLink({ plugin, tenantId }); return NextResponse.json(link); } ``` Or proxy the full management handler at `/api/corsair/[...path]` and POST to `/api/corsair/connect/links` from the client with your auth middleware in front. ```ts routes/connect-link.ts theme={null} import type { Request, Response } from 'express'; import { corsair } from '../corsair'; export async function createConnectLinkHandler(req: Request, res: Response) { const tenantId = req.session?.userId; if (!tenantId) { res.status(401).json({ error: 'Unauthorized' }); return; } const plugin = req.body?.plugin as string | undefined; if (!plugin) { res.status(400).json({ error: 'plugin is required' }); return; } const link = await corsair.manage.connect.createLink({ plugin, tenantId }); res.json(link); } ``` `createLink` returns `{ connectUrl, expiresAt }`. Redirect the user's browser to `connectUrl`. The signed `state` is already embedded in that URL. ## The connect page `connectUrl` points at your `manual.baseUrl` with `?state=…`. This page verifies the state and redirects the user to the provider's OAuth screen. ```ts app/connect/page.tsx theme={null} import { redirect } from 'next/navigation'; import { corsair } from '@/server/corsair'; export default async function ConnectPage({ searchParams, }: { searchParams: Promise<{ state?: string }>; }) { const { state } = await searchParams; if (!state) { return

Missing state.

; } const { oauthUrl } = await corsair.manage.connect.resolve(state); redirect(oauthUrl); } ```
```ts routes/connect-page.ts theme={null} import type { Request, Response } from 'express'; import { corsair } from '../corsair'; export async function connectPageHandler(req: Request, res: Response) { const state = req.query.state as string | undefined; if (!state) { res.status(400).send('Missing state.'); return; } try { const { oauthUrl } = await corsair.manage.connect.resolve(state); res.redirect(oauthUrl); } catch (err) { const message = err instanceof Error ? err.message : String(err); res.status(400).send(message); } } ```
## The callback route After the user approves, the provider redirects to `manual.redirectUri` with `?code=` and `?state=`. Exchange the code for tokens and store them encrypted for the tenant. Corsair re-verifies the HMAC-signed `state` inside `oauthCallback`. The `tenantId` and `plugin` are extracted from state — do not trust query parameters for tenant identity. ```ts app/api/oauth/callback/route.ts theme={null} import type { NextRequest } from 'next/server'; import { NextResponse } from 'next/server'; import { corsair } from '@/server/corsair'; function escapeHtml(value: string): string { return value .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, '''); } export async function GET(request: NextRequest) { const { searchParams } = new URL(request.url); const code = searchParams.get('code'); const state = searchParams.get('state'); const error = searchParams.get('error'); if (error) { return new NextResponse( `

Authorization failed

${escapeHtml(error)}

`, { status: 400, headers: { 'Content-Type': 'text/html' } }, ); } if (!code || !state) { return new NextResponse('

Missing code or state.

', { status: 400 }); } try { const result = await corsair.manage.connect.oauthCallback({ code, state }); return NextResponse.redirect( `/dashboard?connected=${encodeURIComponent(result.plugin)}`, ); } catch (err) { const message = err instanceof Error ? err.message : String(err); return new NextResponse( `

OAuth error

${escapeHtml(message)}

`, { status: 500, headers: { 'Content-Type': 'text/html' } }, ); } } ```
```ts routes/oauth-callback.ts theme={null} import type { Request, Response } from 'express'; import { corsair } from '../corsair'; function escapeHtml(value: string): string { return value .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, '''); } export async function oauthCallbackHandler(req: Request, res: Response) { const code = req.query.code as string | undefined; const state = req.query.state as string | undefined; const error = req.query.error as string | undefined; if (error) { res.status(400).send( `

Authorization failed

${escapeHtml(error)}

`, ); return; } if (!code || !state) { res.status(400).send('

Missing code or state parameter.

'); return; } try { const result = await corsair.manage.connect.oauthCallback({ code, state }); res.redirect(`/dashboard?connected=${encodeURIComponent(result.plugin)}`); } catch (err) { const message = err instanceof Error ? err.message : String(err); res.status(500).send( `

OAuth error

${escapeHtml(message)}

`, ); } } ```
*** ## Environment variables | Variable | Description | | ------------- | --------------------------------------------------------------------------------------------------------------- | | `CORSAIR_KEK` | Key-encryption key — generate with `openssl rand -hex 32`. Never rotate without re-encrypting stored DEKs. | | `APP_URL` | Your app's public base URL (e.g. `https://myapp.com`). Used to build `manual.baseUrl` and `manual.redirectUri`. | | `NODE_ENV` | Set to `production` to enable HTTPS-only cookies and other hardening elsewhere in your app. | *** ## Security checklist `createLink` is behind authentication — `tenantId` comes from your session, not user input `manual.baseUrl` and `manual.redirectUri` use your HTTPS domain in production The connect page calls `resolve(state)` — Corsair verifies the HMAC before returning the OAuth URL The callback calls `oauthCallback({ code, state })` — Corsair re-verifies state and exchanges the code All user-controlled values are HTML-escaped before rendering error pages OAuth redirect URI registered with the provider matches `manual.redirectUri` exactly *** ## Hub mode If you prefer Corsair to host the connect UI, use `hub: { ... }` instead of `manual`. You only mint a link and mount a delivery endpoint — no connect page or callback route needed. Hub stores none of your credentials; tokens still land in your database. See [Hub overview](/hub/overview) for the model, [Manual or Hub](/hub/manual-vs-hub) for a side-by-side, and [Connect / OAuth](/management/connect) for the API. *** ## What's next Unified createLink API — hub and manual modes. How Corsair encrypts and stores tokens, and handles automatic refresh. Scoping every API call and database query per user with withTenant(). Set up Gmail OAuth — a common starting point. # 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. ```ts corsair.ts 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", }, manual: { approvalBaseUrl: "https://your-app.com/approve", onApprovalRequired: ({ approvalUrl }) => `Approval required. Visit ${approvalUrl} to approve or deny, then retry.`, }, 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 ``` 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](/getting-started/quick-start) migration, add this table once. The schema matches what Corsair expects at runtime. ```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 DEFAULT 'default', status TEXT NOT NULL DEFAULT 'pending', expires_at TEXT NOT NULL, error TEXT NULL ); ``` ```bash theme={null} sqlite3 corsair.db < permissions.sql ``` ```powershell theme={null} Get-Content permissions.sql | sqlite3 corsair.db ``` ```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 DEFAULT 'default', status TEXT NOT NULL DEFAULT 'pending', expires_at TEXT NOT NULL, error TEXT NULL ); ``` ```bash theme={null} psql $DATABASE_URL -f permissions.sql ``` ```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 for multi-tenant instances. Defaults to `default` | | `status` | Lifecycle state (see below) | | `expires_at` | ISO8601 timestamp — 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 — 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 — 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: ... })`: 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. *** ## 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. 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 seamless — approve in the UI, 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"), }, ``` *** ## 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`. ### 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. 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 Wire Corsair into Cursor, Claude Code, or any MCP-compatible agent. Scope approvals and credentials per user with withTenant(). The four core tables Corsair uses for synced integration data. Add custom logic before and after API calls — logging, validation, side effects. # Provisioning 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 — 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`). A tenant is any stable ID you choose — user id, org id, workspace slug. ## setupCorsair Call it from your backend, most often on signup — 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. 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, [`processOAuthCallback`](/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 — provision 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 }); } ``` Removing a plugin from code does not delete its database rows. `corsair.manage.tenants.create()` records a tenant but does **not** create account rows — use `setupCorsair` or the CLI to provision. # TypeScript Source: https://docs.corsair.dev/concepts/typescript End-to-end type safety with zero configuration. Corsair is written in TypeScript and designed to be type-safe everywhere. Once you set up your Corsair instance, all API calls, database queries, and responses are fully typed. ```ts example.ts theme={null} // TypeScript knows exactly what parameters are required await corsair.slack.api.channels.create({ name: "engineering", is_private: true, }); // And what the response looks like const channel = await corsair.slack.api.channels.get({ channel: "C01234567", }); console.log(channel.id, channel.name, channel.is_member); ``` ## Why This Matters Without Corsair, you'd write code like this: ```ts without-corsair.ts theme={null} // Raw Slack API — no type safety const response = await fetch("https://slack.com/api/conversations.create", { method: "POST", headers: { "Authorization": `Bearer ${token}`, "Content-Type": "application/json", }, body: JSON.stringify({ name: "engineering" }), }); const data = await response.json(); // data is 'any' ``` You don't know what fields are required. You don't know what the response looks like. You have to check the Slack docs every time. With Corsair: ```ts with-corsair.ts theme={null} // Fully typed — your editor shows exactly what's available const channel = await corsair.slack.api.channels.create({ name: "engineering", // Required is_private: true, // Optional — TypeScript tells you }); channel.id; // ✓ TypeScript knows this exists channel.is_member; // ✓ TypeScript knows this exists channel.foo; // ✗ TypeScript error — property doesn't exist ``` ## Typed Database Queries Database operations are also fully typed based on your plugin schemas. ```ts example.ts theme={null} // The message object is strongly typed const message = await corsair.slack.db.messages.findByResourceId("msg_123"); if (message) { console.log(message.data.text); // ✓ Typed console.log(message.data.channel); // ✓ Typed } ``` ## Consistent Across Integrations Every integration uses the same patterns. Learn once, use everywhere. ```ts example.ts theme={null} // Slack await corsair.slack.api.messages.post({ channel: "C01", text: "Hello" }); // Linear await corsair.linear.api.issues.create({ title: "Bug", teamId: "TEAM_1" }); // Same structure, same types, same patterns ``` ## TypeScript Config We recommend enabling strict mode in your TypeScript configuration for the best experience. ```json tsconfig.json theme={null} { "compilerOptions": { "strict": true } } ``` If you can't use strict mode, at minimum enable `strictNullChecks`: ```json tsconfig.json theme={null} { "compilerOptions": { "strictNullChecks": true } } ``` # Webhooks Source: https://docs.corsair.dev/concepts/webhooks One endpoint for all webhooks, 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 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. 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. 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. # Introduction Source: https://docs.corsair.dev/getting-started/introduction The go-to integration layer for AI agents and apps. Connect anything, anywhere, in seconds. Corsair is the fastest way to add any integration to your app or agent. It handles the authentication and data-sync plumbing every service needs, so you write only the part that's unique to your use case — not the wiring you've already built a hundred times. Every integration is a plugin. Install the ones you need, hand Corsair a database and an encryption key, and each service becomes a typed client in your code — plus one set of tools your agent can call across all of them. One pattern, whether you have a single integration or fifty. [Corsair Hub](/hub/overview) handles the hosted OAuth and approval surfaces so you never build them. Install Corsair and the plugins you need: ```bash npm theme={null} npm install corsair @corsair-dev/slack @corsair-dev/github @corsair-dev/gmail @corsair-dev/linear ``` ```bash yarn theme={null} yarn add corsair @corsair-dev/slack @corsair-dev/github @corsair-dev/gmail @corsair-dev/linear ``` ```bash pnpm theme={null} pnpm install corsair @corsair-dev/slack @corsair-dev/github @corsair-dev/gmail @corsair-dev/linear ``` ```bash bun theme={null} bun add corsair @corsair-dev/slack @corsair-dev/github @corsair-dev/gmail @corsair-dev/linear ``` Each service ships as its own `@corsair-dev/*` package. Find the one you need — and its exact install id — in the [**Plugins**](/guides/plugins) catalog. ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { github } from '@corsair-dev/github'; import { gmail } from '@corsair-dev/gmail'; import { linear } from '@corsair-dev/linear'; import { slack } from '@corsair-dev/slack'; export const corsair = createCorsair({ plugins: [slack(), github(), gmail(), linear()], database: db, kek: process.env.CORSAIR_KEK!, }); ``` Connect it to your agent and start prompting: ``` Invite Jim to next Thursday's sales call. Tell him over Slack too so he can accept it. Let me know when he does. ``` One prompt, four integrations, and Corsair handles the rest. Corsair runs in your own app and stores credentials in your own database. **[Corsair Hub](/hub/overview) is the recommended way to run it** — connect your app, or your users' apps, without hosting the OAuth connect, approval, and webhook surfaces yourself. Hub relays those surfaces and still stores none of your credentials; tokens stay encrypted in your database. Prefer to host those surfaces yourself? That path stays [fully supported](/hub/manual-vs-hub). In a hurry? Hand it to your coding agent. [Set up with your agent](/getting-started/set-up-with-your-agent) is one prompt that wires Corsair Hub end to end — install, route, keys, and a real connected integration. ## Get started Install and run your first integration with Hub in minutes. Paste one prompt and let your coding agent wire Corsair Hub end to end. The hosted relay for connect and approvals — and why it stores no credentials. Slack, Linear, Gmail, GitHub, HubSpot, Stripe, and hundreds more. # Quick Start Source: https://docs.corsair.dev/getting-started/quick-start A working integration in five steps, powered by Hub. The quickest path to a working integration is **Hub**. It 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 still encrypted and stored in your own database — Hub stores none. Want to host those surfaces yourself instead? Every step below is the same; swap the `hub` block for `manual`. See [Manual or Hub](/hub/manual-vs-hub). ## 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 ``` `@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. ## 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 .env theme={null} CORSAIR_KEK=your-generated-kek CORSAIR_DEV_API_KEY=ck_dev_... CORSAIR_DEV_SIGNING_SECRET=... APP_URL=http://localhost:3000 ``` Keep your KEK safe. Lose it and you lose access to every stored credential. Treat it like a root password. ## Create the database Corsair stores data in four 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 ``` ```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) ); ``` ```bash theme={null} sqlite3 corsair.db < migration.sql ``` ```powershell theme={null} Get-Content migration.sql | sqlite3 corsair.db ``` Using Postgres, Drizzle, or Prisma instead? See [Database](/concepts/database) for each option. ## Configure Corsair Wire your database, KEK, and Hub keys together in `src/server/corsair.ts`: ```ts src/server/corsair.ts theme={null} import 'dotenv/config'; 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!, hub: { projectApiKey: process.env.CORSAIR_DEV_API_KEY!, signingSecret: process.env.CORSAIR_DEV_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', }); ``` Add more plugins later — `slack()`, `linear()`, `gmail()` — by appending to the array. ## 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 — 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). *** ## What's next Give an agent the four Corsair tools and let it discover and call any endpoint. How the relay works, and why Hub stores none of your credentials. Development vs production keys — switch to production when you deploy. Building a product? Flip one flag and every user gets their own data and credentials. Postgres, Drizzle, Prisma, and the four tables Corsair uses. Seed credentials and provision tenants from the `corsair` CLI or `setupCorsair`. # Set up with your agent Source: https://docs.corsair.dev/getting-started/set-up-with-your-agent Hand Corsair Hub to your coding agent. One prompt takes it from an empty app to a working, connected integration. The fastest way to add Corsair is to let your coding agent do it. Paste the prompt below into Claude Code, Cursor, Codex, or any MCP-capable agent — it talks you through the two choices that matter, wires the route, and doesn't stop until a real integration works. ```text Prompt theme={null} Help me set up Corsair Hub and get my first integration working end to end. Corsair is an open-source integration layer for apps and AI agents. It connects me — or my users — to services like GitHub, Slack, and Gmail, and handles the OAuth, token refresh, webhooks, and rate limits. It runs inside my own app and stores every credential encrypted in my own database. Corsair Hub is the hosted piece that owns the surfaces needing a public URL: the OAuth connect page, callbacks, and approvals. Hub relays those; it stores none of my credentials. Start by figuring out two things with me — chat about them, don't fire yes/no questions at me. First: am I connecting just my own app's tools, or my end users' accounts? The second is multi-tenant, and it's the common case, so lean that way if I'm unsure. Second: what framework am I on? That's what decides how the route gets mounted. Once that's clear, walk me through it. Read the intro and Hub pages listed at https://docs.corsair.dev/llms.txt so you understand the model first. Help me get a dev API key, a signing secret, and a KEK into my .env — I'll copy the keys from the Keys tab at https://hub.corsair.dev/dashboard, or you help me create a project if I don't have one. Install `corsair` plus a plugin for each service I named, then wire the /api/corsair route using the page for my exact framework at https://docs.corsair.dev/adapters/handlers. Terms you'll come across: a tenant is one of my users; a plugin is one service; the delivery URL is where Hub sends results — it self-registers on the first request, and my dashboard's header dot turning green is how we know it worked. Don't stop at "the server runs" — mint a connect link, send me through it, and confirm a real API call returns data. Prefer Hub. Only set up manual, self-hosted mode if I ask for it. ``` Rather do it by hand? The [Quickstart](/getting-started/quick-start) is the same path, step by step. # 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. **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. Plugins live inside the monorepo alongside the core library. ```bash theme={null} git clone https://github.com/corsairdev/corsair.git cd corsair pnpm install ``` Pass your plugin name in **PascalCase** — e.g. `Stripe`, `GoogleCalendar`, `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`. 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; ``` 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. ```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!, }); ``` 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. **3. 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!, }); ``` **4. 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(); ``` **5. Run the script:** ```bash theme={null} cd demo/testing pnpm run test ``` **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. By the end of this guide you'll have a working Next.js app with a live Google Calendar dashboard — and you'll have written almost none of the UI yourself. ## 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 -- ``` ## 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 ``` ## 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 ``` ## Generate your encryption key Corsair encrypts stored credentials with a Key Encryption Key. Click **Regenerate** for a new one, or run the command yourself: **Keep this key safe** If you lose it, you lose access to all stored credentials. Treat it like a root password. ## 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 ``` ```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) ); ``` ```bash theme={null} sqlite3 corsair.db < migration.sql ``` ```powershell theme={null} Get-Content migration.sql | sqlite3 corsair.db ``` ## 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!, }); ``` ## 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 → 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 ``` 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. ## 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 Full API reference — create events, check availability, and handle webhook notifications. React to calendar changes in real time — new events, updates, and deletions pushed to your server. Chain calendar events to other plugins — meeting created → Slack notification → Linear task. 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. 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" const inReview = await client.linear.db.issues.list({ where: { state: { name: 'In Review' }, team: { id: process.env.LINEAR_TEAM_ID } }, }); for (const issue of inReview) { await client.linear.api.issues.update({ issueId: issue.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 () => { const [inProgress, blocked, unstarted] = await Promise.all([ corsair.linear.db.issues.list({ where: { state: { type: 'started' } }, orderBy: { priority: 'asc' }, }), corsair.linear.db.issues.list({ where: { state: { name: 'Blocked' } }, }), corsair.linear.db.issues.list({ where: { state: { type: 'unstarted' } }, orderBy: { priority: 'asc' }, limit: 5, }), ]); const lines = [ `*Sprint Report — ${new Date().toDateString()}*`, '', `*🔄 In Progress (${inProgress.length})*`, ...inProgress.map((i) => `• *${i.title}* — ${i.assignee?.name ?? 'Unassigned'}`), '', `*🚧 Blocked (${blocked.length})*`, ...blocked.map((i) => `• *${i.title}* — ${i.assignee?.name ?? 'Unassigned'}`), '', `*📋 Up Next (${unstarted.length})*`, ...unstarted.map((i) => `• ${i.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(); ``` 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 Durable step functions triggered from Corsair webhooks. Start Temporal workflows from Corsair webhook events. Background tasks and scheduled jobs with Trigger.dev. Chain webhook events without a job queue. # Inngest Source: https://docs.corsair.dev/guides/inngest Trigger durable Inngest functions from Corsair webhook events. 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, assigneeEmail: result.data.assignee?.email, 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, assigneeEmail, tenantId } = event.data; // Use withTenant if you have multi-tenancy enabled const client = tenantId ? corsair.withTenant(tenantId) : corsair; // Look up the Slack user by email const user = await client.slack.api.users.lookupByEmail({ email: assigneeEmail, }); 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, issue_number: 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 issues = await corsair.linear.db.issues.list({ where: { state: { type: { in: ['started', 'unstarted'] } } }, orderBy: { priority: 'asc' }, }); 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'}*`, '', ...issues.map( (i) => `• *${i.title}* — ${i.assignee?.name ?? 'Unassigned'} (${i.state?.name})`, ), ]; await corsair.slack.api.messages.post({ channel: 'C_ENG_CHANNEL', text: lines.join('\n'), }); }, ); ``` `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 Chain webhook events into multi-step automations with plain TypeScript. Use Temporal workflows and activities with Corsair. Background tasks and scheduled jobs with Trigger.dev. 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.readonly` * `https://www.googleapis.com/auth/gmail.send` * `https://www.googleapis.com/auth/gmail.modify` * `https://www.googleapis.com/auth/gmail.compose` * 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—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: 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. 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 — the minimal trigger pattern. ```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. This is the kind of time-delayed sequence that makes Temporal worth reaching for: 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 — 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 const inProgress = await corsair.linear.db.issues.list({ where: { state: { type: 'started' } }, orderBy: { updatedAt: 'desc' }, }); const blocked = await corsair.linear.db.issues.list({ where: { state: { name: 'Blocked' } }, }); const lines = [ `*Morning Standup — ${new Date().toDateString()}*`, '', `*In Progress (${inProgress.length})*`, ...inProgress.map((i) => `• ${i.title} — ${i.assignee?.name ?? 'Unassigned'}`), '', `*Blocked (${blocked.length})*`, ...blocked.map((i) => `• ${i.title} — ${i.assignee?.name ?? 'Unassigned'}`), ]; await corsair.slack.api.messages.post({ channel: 'C_ENG_STANDUP', text: lines.join('\n'), }); } ``` Use `client.schedule.create()` once at server startup or in a migration script. Subsequent restarts won't duplicate the schedule — Temporal deduplicates by `scheduleId`. *** ## What's next Durable step functions triggered from Corsair webhooks. Background tasks and scheduled jobs with Trigger.dev. Event-driven workflows with Hatchet. 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. 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 const issues = await corsair.sentry.db.issues.list({ where: { status: 'unresolved' }, orderBy: { lastSeen: 'desc' }, limit: 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.title}* — ${i.count} events, last seen ${new Date(i.lastSeen).toLocaleDateString()}`, ), '', `_Triage before Monday_ 👆`, ]; await corsair.slack.api.messages.post({ channel: 'C_ENG_CHANNEL', text: lines.join('\n'), }); }, }); ``` Register scheduled tasks in your Trigger.dev worker entry point. They're automatically deployed and managed — no separate cron infrastructure needed. *** ## What's next Durable step functions triggered from Corsair webhooks. Start Temporal workflows from Corsair webhook events. Event-driven workflows with Hatchet. 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 — a GitHub star, a Slack message, 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. **Get a stable URL (recommended)** Free ngrok accounts get a random URL on every restart — meaning 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 **Register in GitHub:** 1. Go to your repo → **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** — save it 5. Choose events (or "Send me everything") 6. Click **Add webhook** **Store the secret:** ```ts theme={null} await corsair.github.keys.set_webhook_signature(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}`); }, }, }, }) ``` **Register in Slack:** 1. Go to [api.slack.com/apps](https://api.slack.com/apps) → 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:** ```ts theme={null} await corsair.slack.keys.setWebhookSignature(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 Chain webhook events into multi-step automations. Scope incoming webhooks per user with ?tenantId= param. All available GitHub events and payload shapes. 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:** event fires → webhook hook runs → 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: GitHub PR opened → Slack message sent. *** ## Common patterns **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`, }); }, }, }, }) ``` **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'], }); }, }, }, }, }) ``` **PR merged → post Slack message → create 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, issue_number: pr.number, body: review, }); } ); ``` Webhook response stays fast. The work happens in the background. *** ## What's next Get ngrok running and register your first webhook endpoint. All available GitHub events you can react to. All available Slack events you can react to. Full before/after hook API and all available options. # Hub Dashboard Source: https://docs.corsair.dev/hub/dashboard Manage project keys, connection status, sign-in links, and production delivery from hub.corsair.dev. The [Hub dashboard](https://hub.corsair.dev/dashboard) is where you create projects, copy environment credentials, monitor connections, and activate production. Each project has **development** and **production** environments. Switch between them with the environment picker at the top of the project settings. See [Development and Production](/hub/environments) for how they differ. ## Keys tab Copy or rotate the API key and signing secret for the selected environment. | Credential | Used as | | -------------- | -------------------------------------- | | API key | `hub.projectApiKey` in `createCorsair` | | Signing secret | `hub.signingSecret` in `createCorsair` | Development keys start with `ck_dev_`; production keys start with `ck_prod_`. Rotating credentials in the dashboard revokes the old pair immediately — update your app env vars before rotating in production. The **OAuth redirect URL** shown on this tab (`https://auth.corsair.dev/oauth/callback`) is the single callback to register with each OAuth provider. ## Delivery URLs tab (production only) Register the public HTTPS URL where Hub POSTs signed envelopes after production connect sessions, credential deliveries, and approval decisions. This is the **Activate production** step. Until a delivery URL is registered, production connect flows return an error asking you to activate. Development does not use this tab — delivery is auto-detected locally. See [Delivery URLs](/hub/delivery-urls). ## Connections tab The connections table mirrors what your Corsair instance reports when API calls run. Rows are tenants × plugins; cells show connection status (verified, partial, not started, and so on). ### Sign-in links Each tenant row has a **Sign-in link** button. Use it to copy a short-lived connect URL without writing code — useful for onboarding a customer or testing a tenant's integrations. You can generate a link for **unverified plugins only** or for **all plugins** on that tenant. ### Corsair-managed integrations If you use plugins with `authType: 'managed'`, Corsair can host the OAuth app for eligible integrations in production. In development, all configured managed plugins are available. If your plan limits how many integrations Corsair manages in production, the Connections tab asks you to **select which ones** you want Corsair to manage. Save your selection before going live — integrations not selected use bring-your-own OAuth (you supply client id and secret via the dashboard or your app). ### BYO credentials from the dashboard For plugins that need your own OAuth app credentials, open the credentials modal on a plugin column and enter client id and secret. Hub delivers them to your app's handler so they are encrypted and stored in your database. ## Settings tab Project lifecycle settings (delete project, consent screen branding — coming soon). ## What's next Development vs production keys and delivery. Setup from scratch. createLink from your app code. How Hub reaches your handler. # Delivery URLs Source: https://docs.corsair.dev/hub/delivery-urls How Hub delivers OAuth results, credentials, and approval decisions to your app — browser redirect in development, signed POST in production. Without Hub, the OAuth redirect URI you register with a provider has to match the environment handling the callback. Local, staging, and production each need their own redirect URI, which means either separate provider apps or rewriting the registered URI every time you switch environments. With Hub you register **one** callback URL with the provider — `https://auth.corsair.dev/oauth/callback`. Hub receives the callback and delivers the result to your app. **How** it delivers depends on which [environment](/hub/environments) started the flow — development uses a browser redirect; production uses a signed server POST. See [Why delivery works differently](/hub/environments#why-delivery-works-differently) for the full picture. ```mermaid theme={null} flowchart LR P["OAuth Provider
one registered callback"] H[Corsair Hub] D["localhost
(development · browser redirect)"] Pr["your-app.com
(production · signed POST)"] P --> H H --> D H --> Pr ``` ## Mount your handler Your app exposes the delivery endpoint through the mounted Corsair handler. `toNextJsHandler` serves Hub delivery at the base path automatically: ```ts app/api/corsair/[[...path]]/route.ts theme={null} import { toNextJsHandler } from "corsair"; import { corsair } from "@/server"; export const { GET, POST, OPTIONS } = toNextJsHandler(corsair, { basePath: "/api/corsair", }); ``` You do **not** put the delivery URL in your `hub` config. It is resolved per environment (see below). ## Development delivery When your app uses a **development** API key (`ck_dev_…`), the SDK auto-detects where to deliver: ```bash .env.local theme={null} CORSAIR_DEV_API_KEY=ck_dev_... CORSAIR_DEV_SIGNING_SECRET=... # Optional override: CORSAIR_DELIVERY_URL=http://localhost:3001/api/corsair ``` Detection order: `CORSAIR_DELIVERY_URL` (full endpoint URL) → `http://localhost:{PORT}/api/corsair`. Hub **redirects the user's browser** to that URL with a signed payload (`?d=…`). Because delivery is browser-mediated, it reaches `localhost` without a tunnel like ngrok. No dashboard registration is required for development. On its first request, your app **self-registers** this URL with Hub — derived from the app's own config, never from an inbound request — so the dashboard's **App sync** indicator shows it live and turns green while your app is reachable. Pin it with `CORSAIR_DELIVERY_URL`, or edit it in the dashboard. ## Production delivery When your app uses a **production** API key (`ck_prod_…`), Hub POSTs a **signed JSON envelope** to the delivery URL registered in the [Hub dashboard](/hub/dashboard) (**Delivery URLs** tab → Activate production). ```bash theme={null} CORSAIR_PROD_API_KEY=ck_prod_... CORSAIR_PROD_SIGNING_SECRET=... ``` The URL must be a public HTTPS endpoint (not localhost). Hub signs each POST with your `signingSecret`; your handler verifies the signature before accepting it. Register or update the URL in the dashboard before deploying — production connect flows fail until production is activated. ## The signing secret Each delivered payload is signed with your environment's `signingSecret`. Your handler verifies the signature before accepting it, so only payloads from Hub for your project are applied. Keep the signing secret in server-side environment variables, never in client code. Delivery URLs change *where the result is routed*. They do not change where credentials are stored. Tokens are still encrypted and persisted only in your database. See [Hub overview](/hub/overview#hub-stores-none-of-your-credentials). ## What's next Development vs production keys and when to use each. Activate production and manage delivery URLs. The createLink API. What you build in each mode. # Development and Production Source: https://docs.corsair.dev/hub/environments Every Hub project includes a Development and a Production environment. They are meant for different stages of your workflow — use each one appropriately. When you create a project in the [Hub dashboard](https://hub.corsair.dev/dashboard), you get two environments: **Development** and **Production**. They are not interchangeable — each is tuned for a different stage of building and shipping. The SDK knows which one you are using from your API key prefix (`ck_dev_…` or `ck_prod_…`). Point your local app at development keys; point your deployed app at production keys. Both environments share the same OAuth provider callback URL (`https://auth.corsair.dev/oauth/callback`). You register it once with GitHub, Google, and so on — Hub routes the result back to the environment that started the flow. ## Development environment A **Development** environment is the default starting point. It is designed to make local work fast: no delivery URL to register, no tunnel, no production activation step. Some characteristics of Development: * **Optimized for `localhost`.** After OAuth completes, Hub sends the result to your machine via a browser redirect — not a server callback. Your browser can reach `localhost`; Hub's servers often cannot. * **Auto-detected delivery URL.** The SDK figures out where your handler lives from `CORSAIR_DELIVERY_URL` or `PORT`. You do not configure this in the dashboard. * **Separate credentials.** Development has its own API key and signing secret. They are shown on the **Keys** tab when the environment picker is set to Development. * **Relaxed setup.** No "activate" step. As long as your app is running locally and you are using `ck_dev_…` keys, connect flows work. * **All configured plugins available.** Useful for trying integrations before you ship. Production may ask you to choose which Corsair-managed integrations to enable — see [Hub dashboard](/hub/dashboard#corsair-managed-integrations). Development is for building and testing on your machine. It is not a substitute for a deployed production setup. ### Local setup ```bash .env.local theme={null} CORSAIR_DEV_API_KEY=ck_dev_... CORSAIR_DEV_SIGNING_SECRET=... CORSAIR_KEK=... # Optional — override auto-detection: # CORSAIR_DELIVERY_URL=http://localhost:3001/api/corsair ``` Copy development credentials from the dashboard **Keys** tab. Mount your handler at `/api/corsair` and run your app — Hub handles the rest. ## Production environment A **Production** environment is for your live, deployed application — real users, real OAuth flows, real traffic. Some characteristics of Production: * **Requires activation.** Before connect flows work, register a public HTTPS delivery URL in the dashboard (**Delivery URLs** tab). This tells Hub where to send results in production. * **Server-to-server delivery.** Hub POSTs a signed envelope directly to your app. No browser redirect — the user's browser is not in the loop after OAuth completes. * **Stricter URL rules.** Delivery URLs must be public HTTPS endpoints. `localhost` is rejected. * **Separate credentials.** Production has its own API key and signing secret (`ck_prod_…`). Never commit them; set them in your host's environment variables. * **Corsair-managed integrations.** If your plan limits how many integrations Corsair manages in production, the dashboard asks you to select which ones. Development does not apply this limit. When you deploy, switch your env vars from development keys to production keys and complete the activation step first. ### Deploy setup Open your project, switch the environment picker to **Production**, and go to **Delivery URLs**. Register your handler — for example `https://your-app.com/api/corsair`. ```bash theme={null} CORSAIR_PROD_API_KEY=ck_prod_... CORSAIR_PROD_SIGNING_SECRET=... CORSAIR_KEK=... ``` Production connect, credential delivery, and approval flows now POST signed envelopes to your registered URL. ## Why delivery works differently Hub lives on the public internet (`auth.corsair.dev`). Your app does not — at least not while you are developing locally. That gap drives almost every difference between the two environments. **In development**, your app runs on `localhost`. Hub cannot reliably call `http://localhost:3000` from its servers — your machine is not reachable from the internet, and that is fine. Instead, after OAuth completes, Hub **redirects the user's browser** to your local handler with a signed payload (`?d=…`). The browser is already on your machine, so delivery works without ngrok or a tunnel. **In production**, your app runs on a public HTTPS domain. Hub **POSTs a signed envelope** straight to your server. This is more secure and more reliable for live traffic: the result never passes through the browser URL bar, and your handler verifies every payload with your signing secret before accepting it. ```mermaid theme={null} flowchart TB subgraph dev [Development] H1[Hub completes OAuth] B1[User's browser] L[localhost handler] H1 -->|redirect ?d=…| B1 B1 --> L end subgraph prod [Production] H2[Hub completes OAuth] A[your-app.com handler] H2 -->|signed POST| A end ``` Same Hub project, same provider callback URL — different delivery path depending on which API key started the flow. ## Preview and staging Hub provides Development and Production per project. There is no separate "staging" environment type today. Here are practical patterns: Use **development** API keys (`ck_dev_…`) on preview deployments. Set `CORSAIR_DELIVERY_URL` to the preview URL of your handler — for example `https://my-app-git-feature-team.vercel.app/api/corsair`. Hub delivers via browser redirect, same as local development. This works well for PR previews without activating production. Create a **separate Hub project** for staging. Treat its production environment as your staging deploy: activate a delivery URL on your staging domain and use that project's `ck_prod_…` keys. Changes in the staging project do not automatically sync to your main production project — configure each independently. You can point a subdomain of your production domain (for example `staging.your-app.com`) at the same Hub production environment and delivery URL as production. This shares OAuth state and connection data between staging and production, which is usually **not** what you want for isolated testing. Prefer a separate Hub project unless you intentionally want shared connection data. ## Quick reference | | Development | Production | | ---------------- | ----------------------------------------- | --------------------------------- | | API key | `ck_dev_…` | `ck_prod_…` | | Best for | Local dev, PR previews | Deployed app | | Delivery URL | Auto-detected (or `CORSAIR_DELIVERY_URL`) | Registered in dashboard | | How Hub delivers | Browser redirect (`GET ?d=…`) | Signed server POST | | Dashboard setup | Copy keys — done | Activate delivery URL + copy keys | | `localhost` | ✅ | ❌ | ## What's next Handler mounting and signing in more detail. Keys, connections, sign-in links, and activation. Full setup from scratch. The createLink API reference. # Choosing Between Manual and Hub Source: https://docs.corsair.dev/hub/manual-vs-hub The same Corsair instance, two ways to handle the surfaces that need a public URL. Here is exactly what each mode asks you to build. Corsair only differs between modes in one place: the surfaces that need a public URL (OAuth callbacks, approval pages). Everything else (calling APIs, `withTenant`, hooks, the database layer, encryption) is identical. * **Hub** is the recommended path. Corsair hosts the connect, callback, and approval surfaces for you, and stores none of your credentials. See [Hub overview](/hub/overview). * **Manual** is the self-hosted alternative. You host those surfaces yourself — fully featured, no external dependency. The picker is config on `createCorsair`: pass `manual` or `hub`. ## What each mode asks you to build | Surface | Manual (you host it) | Hub (Corsair hosts it) | | ------------------------ | --------------------------------------------------------------- | ---------------------------------------------------------------------- | | OAuth callback URL | One per environment, registered with each provider | One callback for [development and production](/hub/environments) | | Connect page | You build it (`resolve` the signed state, redirect to provider) | Hosted by Hub | | OAuth callback route | You build it (`oauthCallback` exchanges the code) | Hosted by Hub, result delivered to you | | Approval UI | You build a review page and wire `onApprovalRequired` | Hosted approve/deny page, link auto-generated | | Missing-connection error | You craft the message and build the connect page | You call `createLink()` for a sign-in link; Hub hosts the connect page | | Credential storage | Your database | Your database (Hub stores nothing in both modes) | The last row is the key one: **credential storage never changes.** Tokens live in your database under your KEK in both modes. Hub is a relay for the public-URL surfaces, not a vault. ## Config side by side ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { github } from '@corsair-dev/github'; export const corsair = createCorsair({ plugins: [github()], database: db, kek: process.env.CORSAIR_KEK!, manual: { baseUrl: `${appUrl}/connect`, redirectUri: `${appUrl}/api/oauth/callback`, approvalBaseUrl: `${appUrl}/approve`, }, }); ``` You also build the connect page, the OAuth callback route, and the approval review page. See [OAuth Process](/concepts/oauth-process) for the full implementation. ```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_DEV_API_KEY!, signingSecret: process.env.CORSAIR_DEV_SIGNING_SECRET!, }, }); ``` No connect page, callback route, or approval page to build. Mount the handler once — Hub [delivers results](/hub/delivery-urls) to it (auto-detected locally, registered in the dashboard for production). Both modes use the same `createLink` API to start a connect flow. Only where the returned `connectUrl` points changes. See [Connect / OAuth](/management/connect). ## The connect flow in each mode ```mermaid theme={null} sequenceDiagram actor User participant App as Your App participant Surface as Connect surface participant Provider as OAuth Provider Note over App,Surface: Manual — you host the connect surface User->>App: Click "Connect" App->>App: createLink() App->>Surface: Redirect to your /connect page Surface->>Provider: resolve() then redirect Provider->>App: callback ?code — you call oauthCallback() App->>App: tokens encrypted into your DB Note over App,Surface: Hub — Corsair hosts the connect surface User->>App: Click "Connect" App->>App: createLink() App->>Surface: Redirect to Hub connect page Surface->>Provider: Hub handles resolve and callback Provider->>Surface: callback ?code Surface->>App: delivers result to your handler App->>App: tokens encrypted into your DB ``` In both lanes the tokens end up in the same place: your database. Hub removes the two pages you would otherwise build, nothing more. ## Choosing a mode Choose **manual** when you want full control of the connect and approval surfaces, need everything inside your own domain, or cannot add an external hop in the auth path. Choose **hub** when you would rather not build and host those surfaces, or when you want one provider callback to cover [local development and production](/hub/environments) at once. You can also mix: connect through Hub while keeping approvals manual, or the reverse. The two surfaces are configured independently. ## What's next What Hub is and the relay / no-storage model. Development vs production keys and delivery. The full manual-mode implementation with security best practices. The unified createLink API and its error codes. Approval policies, modes, and the review flow. # 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. It stores none of your credentials. 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 is the recommended way to handle them** — a hosted relay that provides those surfaces so you skip the boilerplate. Hub is not a separate product or a separate SDK. It is the same `createCorsair` instance with one extra config block: add it and Corsair routes the public-URL surfaces through Hub. ```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_DEV_API_KEY!, signingSecret: process.env.CORSAIR_DEV_SIGNING_SECRET!, }, }); ``` Want to own those surfaces instead? Self-hosted (`manual`) mode is fully featured — you host the connect, callback, and approval pages yourself. See [Manual or Hub](/hub/manual-vs-hub). ## Hub stores none of your credentials This is the part to internalize first: **Hub is a relay, not a credential store.** It does not keep your users' access or refresh tokens. Tokens pass through the relay and are persisted only in **your** database, under your [KEK](/concepts/auth#envelope-encryption). Compromising the relay exposes no credentials, because there are none there to expose. ```mermaid theme={null} flowchart LR Prov[OAuth Provider] Hub["Corsair Hub
relay only · stores nothing"] 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 never lives anywhere but your database at runtime. ## What Hub provides Three surfaces normally need a public URL. Hub hosts all three: Register one callback URL with the provider. Hub holds it for both [development and production](/hub/environments). No more swapping redirect URIs between environments. 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. 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 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 In a self-hosted setup, 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 (browser redirect locally, signed POST 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`. Sign in to the dashboard, create an organization, then create your first project. You get **development** and **production** environments automatically. 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_DEV_API_KEY=ck_dev_... CORSAIR_DEV_SIGNING_SECRET=... CORSAIR_KEK=... ``` Register `https://auth.corsair.dev/oauth/callback` in each OAuth provider console (GitHub, Google, etc.). This is the single callback Hub holds for every environment. Mount `toNextJsHandler` at `/api/corsair`. In development, Hub auto-detects your localhost delivery URL — no dashboard registration needed. 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 identical to the self-hosted path. The same `createLink` API is used in both modes; only where the link points changes. See [Connect / OAuth](/management/connect) for the reference. ## When to use Hub Reach for Hub when you do not want to build and host connect pages and approval UIs, or when you want one provider callback to cover local development and production. Stay self-hosted when you want full control of those surfaces or cannot add an external dependency in the auth path. 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 Development vs production keys and delivery. Connections, sign-in links, and production activation. A side-by-side of what each mode requires you to build. Browser redirect vs signed POST delivery. # Approvals on Hub Source: https://docs.corsair.dev/hub/permissions Let Hub host the approve/deny UI for gated permissions, so you do not build a review page. [Permissions](/concepts/permissions) gate risky agent actions behind human approval. The policy engine, the modes, and the `corsair_permissions` table work the same regardless of mode. The only thing Hub changes is **who hosts the approve/deny UI**. * **Manual** — you build a review page and wire `manual.onApprovalRequired` so the agent receives a link to it. * **Hub** — Corsair hosts the approval page. When a call is gated, the SDK returns a Hub approval link automatically. Nothing to build. ## How it works on Hub ```mermaid theme={null} sequenceDiagram participant Agent participant Corsair participant DB as corsair_permissions participant Hub as Hub approval UI participant Human Agent->>Corsair: github.api.repositories.delete(...) Corsair->>Corsair: evaluate policy → require_approval Corsair->>DB: INSERT pending record + token Corsair-->>Agent: blocked + Hub approval link Human->>Hub: open link, approve or deny Hub-->>Corsair: signed decision delivered to your handler Corsair->>DB: status → approved Agent->>Corsair: retry Corsair->>Corsair: run endpoint with frozen args Corsair->>DB: status → completed ``` The approval record still lives in **your** `corsair_permissions` table. Hub renders the UI and delivers the signed decision to your handler, which writes it to your database. Hub never touches your database and stores no approval data of its own. Delivery uses the same [environment-specific transport](/hub/delivery-urls) as connect flows — browser redirect in development, signed POST in production. ## Configuration With `hub` configured, blocked calls include a hosted approval URL with no extra setup: ```ts corsair.ts theme={null} export const corsair = createCorsair({ plugins: [ github({ permissions: { mode: "cautious", overrides: { "repositories.delete": "deny" }, }, }), ], database: db, kek: process.env.CORSAIR_KEK!, permissions: { timeout: "1h", onTimeout: "deny", mode: "asynchronous", }, hub: { projectApiKey: process.env.CORSAIR_DEV_API_KEY!, signingSecret: process.env.CORSAIR_DEV_SIGNING_SECRET!, }, }); ``` Compare with manual mode, where you provide the review surface yourself: ```ts corsair.ts theme={null} manual: { approvalBaseUrl: `${appUrl}/approve`, onApprovalRequired: ({ approvalUrl }) => `Approval required. Visit ${approvalUrl} then retry.`, }, ``` Approvals require the `corsair_permissions` table in both modes. Hub hosts the UI, not the data. See [Permissions](/concepts/permissions#add-the-permissions-table) for the migration. ## Mixing modes Connect through Hub while keeping approvals manual, or the reverse. The two surfaces are independent: pass both blocks and Hub handles connect while your own page handles approvals. ```ts corsair.ts theme={null} export const corsair = createCorsair({ multiTenancy: false, database: db, kek: process.env.CORSAIR_KEK!, permissions: { timeout: "10m", onTimeout: "deny", }, // Hub hosts the connect surface hub: { projectApiKey: process.env.CORSAIR_DEV_API_KEY!, signingSecret: process.env.CORSAIR_DEV_SIGNING_SECRET!, }, // Approvals stay on your own page manual: { // Corsair appends the token: ${appUrl}/permissions/[token] approvalBaseUrl: `${appUrl}/permissions`, onApprovalRequired: ({ approvalUrl }) => `Send the user to ${approvalUrl} to approve this permission.`, }, plugins: [github({ authType: "managed" })], }); ``` `approvalBaseUrl` is the only `manual` field you need for this; Corsair turns it into a per-request `/[token]` URL and surfaces it through `onApprovalRequired`. Connect still routes through Hub because the `hub` block is present. ## What's next Policies, modes, overrides, and the full approval lifecycle. What each mode asks you to build. The relay model and the surfaces Hub hosts. How approvals gate agent tool calls. # Hub REST API Source: https://docs.corsair.dev/hub/rest-api Integrate Corsair Hub from any language over plain HTTP — no SDK required. The Corsair SDK is TypeScript-only, but Hub itself is a plain HTTP service. A Go, Python, or Ruby backend integrates by calling these endpoints directly. Credentials are still delivered to **your** endpoint and stored in **your** database — Hub stores none. Every request authenticates with your project API key: ```http theme={null} Authorization: Bearer ck_dev_... ``` ## Create a connect session ```bash cURL theme={null} curl -X POST https://auth.corsair.dev/connect/sessions \ -H "Authorization: Bearer $CORSAIR_DEV_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "tenantId": "user_123", "deliveryUrl": "https://yourapp.com/api/corsair", "plugins": [{ "plugin": "github", "oauthMode": "managed" }] }' ``` ```ts Node theme={null} const res = await fetch("https://auth.corsair.dev/connect/sessions", { method: "POST", headers: { Authorization: `Bearer ${process.env.CORSAIR_DEV_API_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ tenantId: "user_123", deliveryUrl: "https://yourapp.com/api/corsair", plugins: [{ plugin: "github", oauthMode: "managed" }], }), }); const { connectUrl } = await res.json(); ``` ```python Python theme={null} import os, requests res = requests.post( "https://auth.corsair.dev/connect/sessions", headers={"Authorization": f"Bearer {os.environ['CORSAIR_DEV_API_KEY']}"}, json={ "tenantId": "user_123", "deliveryUrl": "https://yourapp.com/api/corsair", "plugins": [{"plugin": "github", "oauthMode": "managed"}], }, ) connect_url = res.json()["connectUrl"] ``` ```go Go theme={null} payload, _ := json.Marshal(map[string]any{ "tenantId": "user_123", "deliveryUrl": "https://yourapp.com/api/corsair", "plugins": []map[string]string{{"plugin": "github", "oauthMode": "managed"}}, }) req, _ := http.NewRequest("POST", "https://auth.corsair.dev/connect/sessions", bytes.NewReader(payload)) req.Header.Set("Authorization", "Bearer "+os.Getenv("CORSAIR_DEV_API_KEY")) req.Header.Set("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) ``` Returns `{ "connectUrl", "token", "projectId", "expiresAt" }`. Redirect the user's browser to `connectUrl`. Hub hosts the connect page and the OAuth callback. ## Receive the delivery When the user finishes connecting, Hub POSTs a signed JSON envelope to your `deliveryUrl`. The body is `{ "type", "payload" }`, with these headers: | Header | Value | | --------------------- | ---------------------------------------------------------------------------------------- | | `x-corsair-signature` | `sha256=` — HMAC-SHA256 of the **raw request body**, keyed with your signing secret | | `x-corsair-timestamp` | Unix seconds when Hub sent it; reject if older than a few minutes (replay guard) | | `x-corsair-project` | Your project id | | `x-corsair-nonce` | Unique per delivery | Verify before trusting the body — recompute the HMAC over the raw bytes and compare in constant time: ```python Python theme={null} import hashlib, hmac, time def verify(raw_body: bytes, headers, signing_secret: str) -> bool: sig = headers["x-corsair-signature"].removeprefix("sha256=") ts = int(headers["x-corsair-timestamp"]) if abs(time.time() - ts) > 300: # reject stale deliveries return False expected = hmac.new(signing_secret.encode(), raw_body, hashlib.sha256).hexdigest() return hmac.compare_digest(sig, expected) # constant-time compare ``` ```ts Node theme={null} import { createHmac, timingSafeEqual } from "node:crypto"; function verify(rawBody: Buffer, headers: Record, signingSecret: string): boolean { const sig = headers["x-corsair-signature"].replace(/^sha256=/, ""); const ts = parseInt(headers["x-corsair-timestamp"] ?? "0", 10); if (isNaN(ts) || Math.abs(Date.now() / 1000 - ts) > 300) return false; // reject stale or malformed const expected = createHmac("sha256", signingSecret).update(rawBody).digest("hex"); const a = Buffer.from(sig), b = Buffer.from(expected); return a.length === b.length && timingSafeEqual(a, b); // constant-time } ``` ```go Go theme={null} func verify(rawBody []byte, headers http.Header, signingSecret string) bool { sig := strings.TrimPrefix(headers.Get("x-corsair-signature"), "sha256=") ts, _ := strconv.ParseInt(headers.Get("x-corsair-timestamp"), 10, 64) if math.Abs(float64(time.Now().Unix()-ts)) > 300 { // reject stale return false } mac := hmac.New(sha256.New, []byte(signingSecret)) mac.Write(rawBody) expected := hex.EncodeToString(mac.Sum(nil)) return hmac.Equal([]byte(sig), []byte(expected)) // constant-time } ``` Only after `verify` passes: parse the body, exchange or store the credential, and respond `200`. ## List connections ```bash cURL theme={null} curl https://auth.corsair.dev/projects/{projectId}/connections \ -H "Authorization: Bearer $CORSAIR_DEV_API_KEY" ``` Returns an array of `{ tenantId, plugin, status, authKind, connectedAt, expiresAt }`, deduplicated by `tenantId:plugin`. ## Rate limits Connect and permission session creation share a limit of **100 sessions per hour per project**. Over the limit returns HTTP 429. Malformed requests do not consume quota. # Setup Source: https://docs.corsair.dev/hub/setup Wire the Corsair SDK into your app with Hub — install, add the /api/corsair route, add your keys, and start. Your app self-registers on first run. Add Corsair Hub to a TypeScript app in five steps. Your app registers itself with Hub the first time it serves a request, so there is no delivery URL to type into the dashboard — the **App sync** indicator in the header turns green when it connects. Prefer to hand this to a coding agent? Point it at this page: *"Set up Corsair Hub in this app. Follow [https://docs.corsair.dev/hub/setup.md](https://docs.corsair.dev/hub/setup.md) end to end."* It works through the same five steps below. ## Prerequisites A Hub project. Open your project's **Keys** tab in the [dashboard](/hub/dashboard) to copy its API key and signing secret. Secrets are shown once — never log or commit them. ## 1. Install Corsair and a plugin ```bash theme={null} npm i corsair @corsair-dev/github ``` `@corsair-dev/github` is an example — swap it for the integration your app needs. Browse the [integrations catalog](https://api.corsair.dev/md/integrations) for plugin ids. ## 2. Create `corsair.ts` and link your database ```ts corsair.ts theme={null} import "dotenv/config"; import { createCorsair } from "corsair"; import { github } from "@corsair-dev/github"; export const corsair = createCorsair({ kek: process.env.CORSAIR_KEK!, database: db, hub: { projectApiKey: process.env.CORSAIR_DEV_API_KEY!, signingSecret: process.env.CORSAIR_DEV_SIGNING_SECRET!, }, plugins: [github()], }); ``` Pass your app's database as `database`. Corsair persists connections and synced data there — Hub stores none of it (see [Hub overview](/hub/overview#hub-stores-none-of-your-credentials)). ## 3. Add the `/api/corsair` route The handler serves Hub delivery — OAuth callbacks, connect pages, and self-registration — plus the management API, at its base path. Mount the adapter for your server: ```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', }); ``` Pages Router? Export a catch-all API route at `pages/api/corsair/[...path].ts` and forward `req`/`res` through the same `toNextJsHandler`. The App Router is the supported default. ```ts server.ts theme={null} import express from 'express'; import { toExpressHandler } from 'corsair'; import { corsair } from './corsair'; const app = express(); // Required: Hub delivers results as JSON POSTs. The adapter reads the parsed // body, so express.json() must run before the Corsair route. app.use(express.json()); app.use('/api/corsair', toExpressHandler(corsair, { basePath: '/api/corsair' })); app.listen(3000); ``` Mount `express.json()` **before** the Corsair route. Without it, `req.body` is undefined and Hub's delivery POSTs arrive empty — connects will look like they hang. ```ts index.ts theme={null} import { Hono } from 'hono'; import { toHonoHandler } from 'corsair'; import { corsair } from './corsair'; const app = new Hono(); // Wildcard: Corsair routes several paths under the base (delivery, connect, // tenants). Match them all with `/*`, and keep basePath in sync with the mount. app.all('/api/corsair/*', toHonoHandler(corsair, { basePath: '/api/corsair' })); export default app; ``` Every adapter wraps one primitive: `managementHandler(corsair)` returns `(request: Request) => Promise`. Any framework whose routes speak the Fetch API calls it directly — no adapter needed. ```ts SvelteKit theme={null} // src/routes/api/corsair/[...path]/+server.ts import { managementHandler } from 'corsair'; import { corsair } from '$lib/server/corsair'; const handler = managementHandler(corsair, { basePath: '/api/corsair' }); export const GET = ({ request }) => handler(request); export const POST = ({ request }) => handler(request); ``` ```ts Remix theme={null} // app/routes/api.corsair.$.ts import { managementHandler } from 'corsair'; import { corsair } from '~/server/corsair'; const handler = managementHandler(corsair, { basePath: '/api/corsair' }); export const loader = ({ request }) => handler(request); export const action = ({ request }) => handler(request); ``` ```ts Astro theme={null} // src/pages/api/corsair/[...path].ts import { managementHandler } from 'corsair'; import { corsair } from '../../../server/corsair'; const handler = managementHandler(corsair, { basePath: '/api/corsair' }); export const GET = ({ request }) => handler(request); export const POST = ({ request }) => handler(request); export const prerender = false; ``` ```ts Nuxt theme={null} // server/routes/api/corsair/[...path].ts import { fromWebHandler } from 'h3'; import { managementHandler } from 'corsair'; import { corsair } from '~/server/corsair'; // h3's fromWebHandler adapts the (Request) => Response handler to Nitro. export default fromWebHandler( managementHandler(corsair, { basePath: '/api/corsair' }), ); ``` ```ts Workers / Bun / Deno theme={null} import { managementHandler } from 'corsair'; import { corsair } from './corsair'; const handler = managementHandler(corsair, { basePath: '/api/corsair' }); export default { fetch: (request: Request) => handler(request) }; ``` Backend not in JavaScript? Corsair's SDK is TypeScript-only. Integrate over the [Hub REST API](/hub/rest-api) instead. You do not put the delivery URL in your `hub` config — it is resolved per environment (see [Delivery URLs](/hub/delivery-urls)). ## 4. Add your keys to `.env` Copy the values from your project's **Keys** tab. Never commit them. ```bash .env theme={null} CORSAIR_DEV_API_KEY=ck_dev_... CORSAIR_DEV_SIGNING_SECRET=... CORSAIR_KEK=... ``` The env var names are your choice — the dashboard uses `CORSAIR_DEV_*` for development and `CORSAIR_PROD_*` for production so both can coexist. Match whatever you reference in `corsair.ts`. ## 5. Start your app ```bash theme={null} npm run dev ``` The first request to `/api/corsair` registers this app's delivery URL with Hub automatically. The **App sync** indicator in the dashboard header turns green — you are connected. The delivery URL is derived from your app's own config (`CORSAIR_DELIVERY_URL` → `PORT`), never from an inbound request, and only development keys self-register. See [Delivery URLs](/hub/delivery-urls) for detection order and production setup. ## What's next How development and production delivery differ. Development vs production keys. Mint a connect link so users can sign in. Manage keys, connections, and delivery URLs. # Connect / OAuth Source: https://docs.corsair.dev/management/connect Connect users to Slack, GitHub, and other plugins — one createLink API, config-driven hub or manual mode. When a user clicks "Connect GitHub" in your dashboard, your backend calls `client.connect.createLink()`, redirects them to the returned `connectUrl`, and Corsair handles the rest. The same API works in both modes — **`hub`** or **`manual`** config on `createCorsair` picks the backend: | Config | Where `connectUrl` points | What you build | | ---------------------------------- | ------------------------- | ----------------------------- | | `hub: { ... }` | Corsair Hub hosted UI | Delivery endpoint only | | `manual: { baseUrl, redirectUri }` | Your app's connect page | Connect page + OAuth callback | New to the difference? [Hub overview](/hub/overview) explains the relay model and [Manual or Hub](/hub/manual-vs-hub) compares the two side by side. This page is the API reference for both. ## Response shape Every `createLink` call returns: ```ts theme={null} type ConnectLink = { connectUrl: string; // redirect the user's browser here expiresAt?: string; // ISO timestamp — always set in practice }; ``` Redirect to `connectUrl`. That is the entire client-side contract. ## Hub mode (hosted connect UI) Use this when you want Corsair Hub to handle the connect pages, OAuth redirects, and token delivery. ```ts server.ts theme={null} export const corsair = createCorsair({ plugins: [github(), slack()], database, kek, hub: { projectApiKey: process.env.CORSAIR_DEV_API_KEY!, signingSecret: process.env.CORSAIR_DEV_SIGNING_SECRET!, }, }); ``` Use a **development** key (`ck_dev_…`) locally and a **production** key (`ck_prod_…`) when deployed. See [Environments](/hub/environments). Mount one route (optional catch-all so bare `/api/corsair` hits hub delivery too): ```ts app/api/corsair/[[...path]]/route.ts theme={null} import { toNextJsHandler } from "corsair"; import { corsair } from "@/server"; export const { GET, POST, OPTIONS } = toNextJsHandler(corsair, { basePath: "/api/corsair", }); ``` `toNextJsHandler` serves hub delivery at the base path (GET `?d=…`, signed POST, OPTIONS CORS) and the management API on subpaths (`/ok`, `/connect/links`, etc.). Create a connect link and redirect: ```ts backend.ts theme={null} const { connectUrl } = await client.connect.createLink({ plugin: "github", tenantId: "acme", }); window.location.href = connectUrl; ``` Hub-specific optional overrides (ignored in manual mode): | Field | Purpose | | -------------- | ------------------------------------------------------- | | `plugin` | Optional — omit to show all configured plugins | | `oauthMode` | Optional — inferred from plugin `authType` when omitted | | `providerName` | Optional — override provider display name in Hub UI | Hub delivers results to your handler. In development the SDK auto-detects the delivery URL; in production it uses the URL registered in the [Hub dashboard](/hub/dashboard). You do **not** call `resolve` or `oauthCallback`. ## Manual mode (self-hosted) Use this when you want full control over connect pages and OAuth callbacks. ```ts server.ts theme={null} export const corsair = createCorsair({ plugins: [github(), slack()], database, kek, manual: { baseUrl: "https://app.example.com/connect", redirectUri: "https://app.example.com/api/oauth/callback", }, }); ``` Mount the management handler and build two pages: 1. **Connect page** at `manual.baseUrl` — receives `?state=…`, resolves to the provider OAuth URL 2. **OAuth callback** at `manual.redirectUri` — receives `?code=…&state=…`, exchanges for tokens ### Step 1 — Create the connect link ```ts backend.ts theme={null} const { connectUrl } = await client.connect.createLink({ plugin: "github", tenantId: "acme", }); window.location.href = connectUrl; ``` In React: ```tsx connect-button.tsx theme={null} function ConnectGithub({ tenantId }: { tenantId: string }) { const { mutate, loading } = useCreateConnectLink(); return ( ); } ``` The signed `state` is embedded in `connectUrl` as a query parameter — you do not need to handle it separately. ### Step 2 — Resolve The browser hits your connect page with `?state=…`. Call resolve to get the provider OAuth URL: ```ts theme={null} const resolved = await client.connect.resolve(state); // redirect to resolved.oauthUrl ``` Or use `corsair.manage.connect.resolve(state)` in-process. ### Step 3 — OAuth callback The provider redirects back with `?code=…&state=…`: ```ts app/api/oauth/callback/route.ts theme={null} import { corsair } from "@/server"; export async function GET(req: Request) { const url = new URL(req.url); const code = url.searchParams.get("code")!; const state = url.searchParams.get("state")!; await corsair.manage.connect.oauthCallback({ code, state }); return Response.redirect("/dashboard?connected=1"); } ``` Corsair re-verifies the state, exchanges the code, encrypts tokens, and stores them. ## Checking connection status After a successful connect, `useConnectionStatus({ tenantId })` reflects the new state: ```tsx status.tsx theme={null} const { data, refetch } = useConnectionStatus({ tenantId: "acme" }); // data: { github: 'connected', slack: 'not_connected', ... } ``` Call `refetch()` after connect completes to update the dashboard. ## Errors | Status | `error` | When | | ------ | ------------------------- | -------------------------------------------------------------------- | | 500 | `connect_not_configured` | Neither `hub` nor `manual` config was passed | | 500 | `connect_misconfigured` | Invalid `manual.baseUrl`, or missing connect URLs for manual connect | | 500 | `database_not_configured` | `database` and `kek` required to issue connect links | | 400 | `missing_credentials` | Plugin OAuth client id / secret not configured (manual mode BYO) | | 400 | `hub_mode` | `resolve` or `oauthCallback` called when only `hub` is configured | | 500 | `resolve_failed` | State invalid or expired (manual mode) | | 502 | `oauth_callback_failed` | Provider rejected the code (manual mode) | All client errors surface as `CorsairClientError` with these `code` values. # Handler Source: https://docs.corsair.dev/management/handler managementHandler() turns a Corsair instance into a framework-agnostic fetch handler exposing the management routes. `managementHandler(corsair, opts)` returns a single function: `(req: Request) => Promise`. Mount it anywhere that speaks the Fetch API. For Next.js, Express, and Hono there are one-line adapters. ```ts theme={null} import { managementHandler } from "corsair"; const handler = managementHandler(corsair, { basePath: "/api/corsair" }); // handler: (req: Request) => Promise ``` ## Routes The handler dispatches 9 read/write routes. Connect/OAuth is covered separately on the [Connect page](/management/connect). | Method | Path | Purpose | | ------ | ------------------------------ | ----------------------------------------- | | GET | `/ok` | Health check → `{ ok: true }` | | GET | `/tenants` | List tenants | | POST | `/tenants` | Create a tenant | | GET | `/tenants/:id` | Get one tenant | | GET | `/plugins` | List plugins + whether each is configured | | GET | `/plugins/:id` | Get one plugin | | GET | `/connection-status` | Per-plugin OAuth status for a tenant | | GET | `/permissions/:id` | Get a permission record | | POST | `/permissions/lookup-by-token` | Resolve a permission by email-link token | All routes return JSON. Errors return `{ error, message, …extra }` with a non-2xx status — see [Errors](#errors). ## Options ```ts theme={null} managementHandler(corsair, { basePath: "/api/corsair", // optional — stripped before route matching onError: (err, req) => undefined, // optional — return a Response to override, or undefined to fall through }); ``` `basePath` defaults to `"/api/corsair"`. Set it to whatever prefix your framework mounts the handler under. The handler strips it before matching routes, so `/api/corsair/tenants` → `/tenants`. `onError` lets you log or rewrite errors. Return a `Response` to take over, or `undefined` to fall through to the default JSON error. ## Framework adapters Each adapter is a thin wrapper around `managementHandler`. All three are exported from the `corsair` root. ### Next.js ```ts app/api/corsair/[[...path]]/route.ts theme={null} import { toNextJsHandler } from "corsair"; import { corsair } from "@/server"; export const { GET, POST, OPTIONS } = toNextJsHandler(corsair, { basePath: "/api/corsair", }); ``` Works in App Router. `GET`, `POST`, and `OPTIONS` share one handler — hub delivery at the base path plus management subpaths. ### Express ```ts server.ts theme={null} import express from "express"; import { toExpressHandler } from "corsair"; import { corsair } from "./corsair"; const app = express(); app.all("/api/corsair/*", toExpressHandler(corsair, { basePath: "/api/corsair" })); ``` The adapter bridges Express's `(req, res)` to a Fetch `Request` and back. ### Hono ```ts server.ts theme={null} import { Hono } from "hono"; import { toHonoHandler } from "corsair"; import { corsair } from "./corsair"; const app = new Hono(); app.all("/api/corsair/*", toHonoHandler(corsair, { basePath: "/api/corsair" })); ``` The Hono context is mapped to the underlying `Request`/`Response`. ## In-process API Sometimes you don't want HTTP — you want to call the same operations directly from server code (e.g. inside a server action, a job, or a CLI). The handler is built on top of `corsair.manage.*`, available without going through the handler: ```ts in-process.ts theme={null} await corsair.manage.tenants.list(); await corsair.manage.tenants.create({ id: "acme" }); await corsair.manage.plugins.get("github"); await corsair.manage.connectionStatus.get({ tenantId: "acme" }); ``` Every route on the HTTP handler has a matching `manage.*` method with the same shape. ## Errors Errors come back as JSON in this flat shape: ```json theme={null} { "error": "not_found", "message": "No tenant with id acme" } ``` In-process `corsair.manage.*` calls throw errors with `status`, `code`, `message`, and `extra` fields — the same shape HTTP clients surface as [`CorsairClientError`](/adapters/client#error-handling). Common codes you'll see from the management routes: | Status | `error` | When | | ------ | ------------- | ------------------------------------------ | | 400 | `bad_request` | Missing or invalid request body / params | | 404 | `not_found` | Tenant / plugin / permission lookup misses | Connect-route codes are documented on the [Connect page](/management/connect#errors). # Overview Source: https://docs.corsair.dev/management/overview Mount Corsair's management API in your own app — the same routes app.corsair.dev uses, available to self-hosted dashboards. Corsair has two surfaces: * **Runtime** — `createCorsair()`. Agents call Slack, GitHub, and the rest through this. * **Management API** — the routes behind a dashboard: list tenants, connect OAuth accounts, check plugin status, look up permissions. If you self-host Corsair and want your own dashboard, the management API is what you mount. The shape mirrors [better-auth](https://better-auth.com): ```ts mental-model.ts theme={null} managementHandler(corsair) // server instance → fetch handler toNextJsHandler(corsair) // framework adapter createCorsairClient({ baseURL }) // typed vanilla client createCorsairReactClient({ baseURL }) // typed React hooks ``` All of these (except the React hooks) are exported from the `corsair` package root. ## When to reach for it * You are building a dashboard, an internal tool, or any UI that needs to see Corsair state from outside the agent runtime. * You want a typed HTTP boundary between a frontend and your Corsair server instead of calling `corsair.*` directly. If you only run agents server-side, you don't need this — keep using `corsair.slack.api.*` and friends. ## The pieces The 9 management routes, options, and error shapes. Mounting lives under Adapters. `createCorsairClient` — typed fetch wrapper. Works in any JS runtime. `createCorsairReactClient` — typed `useTenants`, `useConnectionStatus`, etc. One `createLink` API — hub or self-hosted, config-driven. ## End-to-end flow ```ts server.ts theme={null} // 1. Your existing Corsair instance import { createCorsair } from "corsair"; import { github } from "@corsair-dev/github"; import { slack } from "@corsair-dev/slack"; export const corsair = createCorsair({ plugins: [github(), slack()], database, kek, }); ``` ```ts app/api/corsair/[[...path]]/route.ts theme={null} // 2. Mount the management API on your framework import { toNextJsHandler } from "corsair"; import { corsair } from "@/server"; export const { GET, POST, OPTIONS } = toNextJsHandler(corsair, { basePath: "/api/corsair", }); ``` ```tsx app/dashboard/page.tsx theme={null} // 3. Use the typed React hooks in your dashboard "use client"; import { createCorsairReactClient } from "corsair/client/react"; const { useTenants } = createCorsairReactClient({ baseURL: "/api/corsair", }); export function Dashboard() { const { data: tenants, loading } = useTenants(); if (loading) return

Loading…

; return
    {tenants?.map(t =>
  • {t.id}
  • )}
; } ``` That is the whole picture. The next pages cover each layer in detail. ## Auth The management API has **no auth opinion**. Wire your own — NextAuth, Clerk, an API key check, whatever already protects the rest of your dashboard. Put it in front of the handler: ```ts theme={null} import { managementHandler } from "corsair"; const corsairHandler = managementHandler(corsair); export async function GET(req: Request) { const session = await getSession(req); if (!session) return new Response("Unauthorized", { status: 401 }); return corsairHandler(req); } ``` Corsair will not block you, prompt you, or guess. That is intentional. # 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. 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 `corsair_setup` first to check credentials, then `list_operations` to discover available endpoints, then `run_script` to execute. ```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()`. # Coding Agents Source: https://docs.corsair.dev/mcp-adapters/coding-agents Use Corsair's CLI discovery commands with coding agents like Claude Code, Cursor, and Copilot. ## Why coding agents should use Corsair discovery Coding agents work best when they can discover integrations and schemas directly instead of inferring APIs from source files. Corsair provides two CLI commands designed for discovery, without making any external API calls to integrated services: * `pnpm corsair list` * `pnpm corsair schema ` These commands load your local Corsair configuration to reflect its full API surface, making them ideal for agent-driven discovery workflows. This allows agents to inspect available integrations, endpoints, database entities, and schemas before generating integration code. ## CLI commands ```bash theme={null} pnpm corsair list [--plugin=] [--type=api|webhooks|db] ``` Lists every available operation path. ```bash theme={null} pnpm corsair schema ``` Prints the input/output schema for an endpoint, webhook, or DB entity. ## Discover available operations Use `pnpm corsair list` to inspect all available plugins and operations. ```bash theme={null} pnpm corsair list ``` Filter by plugin: ```bash theme={null} pnpm corsair list --plugin=slack ``` Filter by type: ```bash theme={null} pnpm corsair list --type=db ``` This command allows coding agents to discover available operations without reading implementation files. ## Inspect schemas Use `pnpm corsair schema ` to inspect the input and output schema for a specific operation. ```bash theme={null} pnpm corsair schema slack.api.messages.post ``` This command returns: * request schema * response schema * entity shapes * webhook payload structures Agents should inspect schemas before generating integration code. ## Example skill file You can provide these instructions to coding agents using a reusable markdown skill file. ```md theme={null} # Corsair integration When writing code that uses Corsair: 1. Run `pnpm corsair list` to discover available operations. Examples: - `pnpm corsair list --plugin=slack` - `pnpm corsair list --type=db` 2. Run `pnpm corsair schema ` before calling any operation. Example: - `pnpm corsair schema slack.api.messages.post` Never infer endpoint names or argument shapes from source files. Always use the CLI commands as the source of truth. ``` ## Where to place the skill file For Claude Code: ```text theme={null} .claude/corsair.md ``` Or append the contents to an existing: ```text theme={null} CLAUDE.md ``` Other coding agents can use the same instructions as part of their workspace context or system prompts. ## Recommended workflow for coding agents 1. Discover available operations using `pnpm corsair list` 2. Inspect operation schemas using `pnpm corsair schema` 3. Generate integration code from the schema output 4. Avoid inferring APIs from implementation details # Cursor Source: https://docs.corsair.dev/mcp-adapters/cursor Connect Corsair to Cursor via MCP or use the CLI directly. 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 `corsair_setup` first to check credentials, then `list_operations` to discover available endpoints, then `run_script` to execute. ```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. ``` # 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. # MCP Adapters Source: https://docs.corsair.dev/mcp-adapters/mcp-adapters Connect Corsair to any AI framework or agent runtime using MCP adapters. Corsair provides first-class adapters for the most popular AI SDKs and agent runtimes. Each adapter exposes Corsair's tools in the format that framework expects — no manual schema wiring required. ## Available Adapters | Adapter | Use case | | -------------------------------------------- | ---------------------------------------- | | [Anthropic SDK](/mcp-adapters/anthropic-sdk) | Native tool use with Claude models | | [Claude Agent SDK](/mcp-adapters/claude-sdk) | In-process MCP with the Claude Agent SDK | | [OpenAI Agents](/mcp-adapters/openai-agents) | OpenAI Agents SDK tool integration | | [OpenAI](/mcp-adapters/openai) | OpenAI function calling | | [Vercel AI SDK](/mcp-adapters/vercel-ai) | Tools for `useChat` and `streamText` | | [Mastra](/mcp-adapters/mastra) | Mastra agent tool integration | ## Coding Agents For coding agents that use the MCP stdio protocol, see the [Coding Agents](/mcp-adapters/claude-code) section. ## Tools Every adapter exposes the same four tools automatically: | Tool | What it does | | ----------------- | ------------------------------------------------- | | `corsair_setup` | Check auth status and get credential instructions | | `list_operations` | Discover every available API endpoint | | `get_schema` | Inspect parameters for a specific endpoint | | `run_script` | Execute a JS snippet with `corsair` in scope | Your agent calls `corsair_setup` first, then `list_operations` to discover what's available, then `run_script` to execute. No code changes needed as you add plugins. ## How the agent uses Corsair Once connected, your agent follows this pattern automatically: ``` 1. corsair_setup → check auth, get instructions for missing credentials 2. list_operations → discover available endpoints (github.repositories.list, slack.messages.post, ...) 3. get_schema → inspect parameters for a specific endpoint 4. run_script → execute: const repos = await corsair.github.api.repositories.list({ type: 'owner' }) ``` No hard-coding required. As you add plugins, the agent discovers the new endpoints automatically. # OpenAI Source: https://docs.corsair.dev/mcp-adapters/openai Connect Corsair to the OpenAI API over HTTP. Use `getOpenAIMcpConfig` to connect Corsair to the [OpenAI API](https://platform.openai.com/docs) via HTTP transport. Like Vercel AI, OpenAI's MCP support connects 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. # OpenAI Agents Source: https://docs.corsair.dev/mcp-adapters/openai-agents Connect Corsair to the OpenAI 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. # 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/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. **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 | — | ```ts theme={null} { status: string, status_detail: string, is_format_valid: boolean, is_smtp_valid: boolean, is_mx_valid: boolean, mx_records?: string[] | null } ``` ```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 } ``` ```ts theme={null} { first_name?: string | null, last_name?: string | null, email_provider_name?: string | null, organization_name?: string | null, organization_type?: string | null } ``` ```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 } ``` ```ts theme={null} { address_risk_status?: string | null, domain_risk_status?: string | null } ``` ```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[]` ```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. **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 Abstract plugin for Corsair Use **Abstract** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 4 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/abstract ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { abstract } from '@corsair-dev/abstract'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [abstract()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { abstract } from '@corsair-dev/abstract'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [abstract()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/abstract/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=abstract ``` Use the key names documented in [Get Credentials](/plugins/abstract/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=abstract --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} abstract() ``` Store credentials with `pnpm corsair setup --plugin=abstract` (see [Get Credentials](/plugins/abstract/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.abstract.db..search()` and `.list()`. See [Database](/plugins/abstract/database) for filters and operators. ## Example API calls **Read-style (read):** `email.reputation` ```ts theme={null} await corsair.abstract.api.email.reputation({}); ``` **Write-style (write):** `—` *No write-style endpoint inferred; pick any operation from the reference below.* See the full list on the [API](/plugins/abstract/api) page. Use `pnpm corsair list --plugin=abstract` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ---------------------------------------------------- | | API | [API](/plugins/abstract/api) | | Database | [Database](/plugins/abstract/database) | | Credentials | [Get credentials](/plugins/abstract/get-credentials) | # 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. **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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 ActiveTrail plugin for Corsair Use **ActiveTrail** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 159 typed API operations * 3 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/activetrail ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { activetrail } from '@corsair-dev/activetrail'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [activetrail()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { activetrail } from '@corsair-dev/activetrail'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [activetrail()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/activetrail/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=activetrail ``` Use the key names documented in [Get Credentials](/plugins/activetrail/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=activetrail --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} activetrail() ``` Store credentials with `pnpm corsair setup --plugin=activetrail` (see [Get Credentials](/plugins/activetrail/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.activetrail.db..search()` and `.list()`. See [Database](/plugins/activetrail/database) for filters and operators. ## Example API calls **Read-style (read):** `account.contactGrowth` ```ts theme={null} await corsair.activetrail.api.account.contactGrowth({}); ``` **Write-style (write):** `account.createContentCategory` ```ts theme={null} await corsair.activetrail.api.account.createContentCategory({}); ``` See the full list on the [API](/plugins/activetrail/api) page. Use `pnpm corsair list --plugin=activetrail` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------------- | | API | [API](/plugins/activetrail/api) | | Database | [Database](/plugins/activetrail/database) | | Credentials | [Get credentials](/plugins/activetrail/get-credentials) | # 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. **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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 Addresszen plugin for Corsair Use **Addresszen** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 4 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/addresszen ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { addresszen } from '@corsair-dev/addresszen'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [addresszen()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { addresszen } from '@corsair-dev/addresszen'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [addresszen()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/addresszen/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=addresszen ``` Use the key names documented in [Get Credentials](/plugins/addresszen/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=addresszen --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} addresszen() ``` Store credentials with `pnpm corsair setup --plugin=addresszen` (see [Get Credentials](/plugins/addresszen/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.addresszen.db..search()` and `.list()`. See [Database](/plugins/addresszen/database) for filters and operators. ## Example API calls **Read-style (read):** `autocomplete.addresses` ```ts theme={null} await corsair.addresszen.api.autocomplete.addresses({}); ``` **Write-style (write):** `—` *No write-style endpoint inferred; pick any operation from the reference below.* See the full list on the [API](/plugins/addresszen/api) page. Use `pnpm corsair list --plugin=addresszen` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------------ | | API | [API](/plugins/addresszen/api) | | Database | [Database](/plugins/addresszen/database) | | Credentials | [Get credentials](/plugins/addresszen/get-credentials) | # 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. **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 | — | ```ts theme={null} { attachment_id: string, size: number, filename?: string, content_type?: string, content_disposition?: string, content_id?: string }[] ``` ```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 | — | ```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 | — | ```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. **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 AgentMail plugin for Corsair Use **AgentMail** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 3 typed API operations * 1 database entity synced for fast `.search()` / `.list()` queries * 1 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/agentmail ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { agentmail } from '@corsair-dev/agentmail'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [agentmail()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { agentmail } from '@corsair-dev/agentmail'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [agentmail()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/agentmail/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=agentmail ``` Use the key names documented in [Get Credentials](/plugins/agentmail/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=agentmail --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} agentmail() ``` Store credentials with `pnpm corsair setup --plugin=agentmail` (see [Get Credentials](/plugins/agentmail/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **1** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/agentmail/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.agentmail.db..search()` and `.list()`. See [Database](/plugins/agentmail/database) for filters and operators. ## Example API calls **Read-style (read):** `messages.get` ```ts theme={null} await corsair.agentmail.api.messages.get({}); ``` **Write-style (write):** `messages.send` ```ts theme={null} await corsair.agentmail.api.messages.send({}); ``` See the full list on the [API](/plugins/agentmail/api) page. Use `pnpm corsair list --plugin=agentmail` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/agentmail/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ----------------------------------------------------- | | API | [API](/plugins/agentmail/api) | | Database | [Database](/plugins/agentmail/database) | | Webhooks | [Webhooks](/plugins/agentmail/webhooks) | | Credentials | [Get credentials](/plugins/agentmail/get-credentials) | # 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). **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 | — | ```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?: { } } ``` ```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 }[] } ``` ```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. **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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { mode?: fast | standard } ``` **Output** | Name | Type | Required | Description | | ---------- | -------- | -------- | ----------- | | `data` | `object` | Yes | — | | `metadata` | `object` | No | — | ```ts theme={null} { } ``` ```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 | — | ```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 } } ``` ```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. **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 AgentQL plugin for Corsair Use **AgentQL** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 4 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/agentql ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { agentql } from '@corsair-dev/agentql'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [agentql()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { agentql } from '@corsair-dev/agentql'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [agentql()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/agentql/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=agentql ``` Use the key names documented in [Get Credentials](/plugins/agentql/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=agentql --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} agentql() ``` Store credentials with `pnpm corsair setup --plugin=agentql` (see [Get Credentials](/plugins/agentql/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.agentql.db..search()` and `.list()`. See [Database](/plugins/agentql/database) for filters and operators. ## Example API calls **Read-style (read):** `data.query` ```ts theme={null} await corsair.agentql.api.data.query({}); ``` **Write-style (write):** `browserSessions.createRemoteBrowserSession` ```ts theme={null} await corsair.agentql.api.browserSessions.createRemoteBrowserSession({}); ``` See the full list on the [API](/plugins/agentql/api) page. Use `pnpm corsair list --plugin=agentql` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | --------------------------------------------------- | | API | [API](/plugins/agentql/api) | | Database | [Database](/plugins/agentql/database) | | Credentials | [Get credentials](/plugins/agentql/get-credentials) | # 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. **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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 Go to [Ahrefs](https://ahrefs.com) and sign in to your account. 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) 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) 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 Ahrefs plugin for Corsair Use **Ahrefs** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 9 typed API operations * 7 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/ahrefs ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { ahrefs } from '@corsair-dev/ahrefs'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [ahrefs()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { ahrefs } from '@corsair-dev/ahrefs'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [ahrefs()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/ahrefs/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=ahrefs ``` Use the key names documented in [Get Credentials](/plugins/ahrefs/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=ahrefs --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} ahrefs() ``` Store credentials with `pnpm corsair setup --plugin=ahrefs` (see [Get Credentials](/plugins/ahrefs/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.ahrefs.db..search()` and `.list()`. See [Database](/plugins/ahrefs/database) for filters and operators. ## Example API calls **Read-style (read):** `keywordsExplorer.overview` ```ts theme={null} await corsair.ahrefs.api.keywordsExplorer.overview({}); ``` **Write-style (write):** `—` *No write-style endpoint inferred; pick any operation from the reference below.* See the full list on the [API](/plugins/ahrefs/api) page. Use `pnpm corsair list --plugin=ahrefs` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | -------------------------------------------------- | | API | [API](/plugins/ahrefs/api) | | Database | [Database](/plugins/ahrefs/database) | | Credentials | [Get credentials](/plugins/ahrefs/get-credentials) | # 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. **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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | --------- | ---------- | -------- | ----------- | | `records` | `object[]` | Yes | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | --------- | ---------- | -------- | ----------- | | `records` | `object[]` | Yes | — | ```ts theme={null} { id: string, createdTime: string, fields: { } }[] ``` *** ### delete `records.delete` Delete a record from a table \[DESTRUCTIVE] **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 | — | ```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 | — | ```ts theme={null} { field: string, direction?: asc | desc }[] ``` **Output** | Name | Type | Required | Description | | --------- | ---------- | -------- | ----------- | | `records` | `object[]` | Yes | — | | `offset` | `string` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | --------- | ---------- | -------- | ----------- | | `records` | `object[]` | Yes | — | ```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. **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 Airtable plugin for Corsair Use **Airtable** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 9 typed API operations * 2 database entities synced for fast `.search()` / `.list()` queries * 1 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/airtable ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { airtable } from '@corsair-dev/airtable'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [airtable()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { airtable } from '@corsair-dev/airtable'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [airtable()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/airtable/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=airtable ``` Use the key names documented in [Get Credentials](/plugins/airtable/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=airtable --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} airtable() ``` Store credentials with `pnpm corsair setup --plugin=airtable` (see [Get Credentials](/plugins/airtable/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **1** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/airtable/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.airtable.db..search()` and `.list()`. See [Database](/plugins/airtable/database) for filters and operators. ## Example API calls **Read-style (read):** `bases.getMany` ```ts theme={null} await corsair.airtable.api.bases.getMany({}); ``` **Write-style (write):** `records.create` ```ts theme={null} await corsair.airtable.api.records.create({}); ``` See the full list on the [API](/plugins/airtable/api) page. Use `pnpm corsair list --plugin=airtable` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/airtable/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ---------------------------------------------------- | | API | [API](/plugins/airtable/api) | | Database | [Database](/plugins/airtable/database) | | Webhooks | [Webhooks](/plugins/airtable/webhooks) | | Credentials | [Get credentials](/plugins/airtable/get-credentials) | # 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). **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 | — | ```ts theme={null} { id: string } ``` ```ts theme={null} { id: string } ``` ```ts theme={null} { source?: string, sourceMetadata?: { user?: { id: string, email?: string, name?: string } } } ``` ```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) { }, }, }, }, }) ``` *** # 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. **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 Algolia plugin for Corsair Use **Algolia** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 133 typed API operations * 3 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/algolia ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { algolia } from '@corsair-dev/algolia'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [algolia()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { algolia } from '@corsair-dev/algolia'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [algolia()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/algolia/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=algolia ``` Use the key names documented in [Get Credentials](/plugins/algolia/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=algolia --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} algolia() ``` Store credentials with `pnpm corsair setup --plugin=algolia` (see [Get Credentials](/plugins/algolia/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.algolia.db..search()` and `.list()`. See [Database](/plugins/algolia/database) for filters and operators. ## Example API calls **Read-style (read):** `abTests.getAbTest` ```ts theme={null} await corsair.algolia.api.abTests.getAbTest({}); ``` **Write-style (write):** `abTests.addAbTest` ```ts theme={null} await corsair.algolia.api.abTests.addAbTest({}); ``` See the full list on the [API](/plugins/algolia/api) page. Use `pnpm corsair list --plugin=algolia` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | --------------------------------------------------- | | API | [API](/plugins/algolia/api) | | Database | [Database](/plugins/algolia/database) | | Credentials | [Get credentials](/plugins/algolia/get-credentials) | # 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. **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```ts theme={null} { event_type?: string, event_time?: string, event_properties?: { }, session_id?: number, amplitude_id?: number }[] ``` ```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 | — | ```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 | — | ```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. **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 Amplitude plugin for Corsair Use **Amplitude** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 17 typed API operations * 3 database entities synced for fast `.search()` / `.list()` queries * 7 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/amplitude ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { amplitude } from '@corsair-dev/amplitude'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [amplitude()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { amplitude } from '@corsair-dev/amplitude'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [amplitude()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/amplitude/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=amplitude ``` Use the key names documented in [Get Credentials](/plugins/amplitude/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=amplitude --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} amplitude() ``` Store credentials with `pnpm corsair setup --plugin=amplitude` (see [Get Credentials](/plugins/amplitude/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **7** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/amplitude/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.amplitude.db..search()` and `.list()`. See [Database](/plugins/amplitude/database) for filters and operators. ## Example API calls **Read-style (read):** `annotations.list` ```ts theme={null} await corsair.amplitude.api.annotations.list({}); ``` **Write-style (write):** `annotations.create` ```ts theme={null} await corsair.amplitude.api.annotations.create({}); ``` See the full list on the [API](/plugins/amplitude/api) page. Use `pnpm corsair list --plugin=amplitude` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/amplitude/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ----------------------------------------------------- | | API | [API](/plugins/amplitude/api) | | Database | [Database](/plugins/amplitude/database) | | Webhooks | [Webhooks](/plugins/amplitude/webhooks) | | Credentials | [Get credentials](/plugins/amplitude/get-credentials) | # 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). **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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { user_id?: string, device_id?: string, user_properties?: { }, country?: string, city?: string, region?: string, language?: string, platform?: string, os?: string } ``` ```ts theme={null} { deployment_name?: string, flag_version?: number } ``` ```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 | — | ```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/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. **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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?: { }[] }[] ``` ```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 | — | ```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?: { }[] }[] ``` ```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 | — | ```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?: { }[] }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { name: string, insert_before?: string, insert_after?: string } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | No | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```ts theme={null} { section: string, before_section?: string, after_section?: string } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | No | — | ```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 | — | ```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 }[] }[] ``` ```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 | — | ```ts theme={null} { name?: string } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | No | — | ```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 | — | ```ts theme={null} { text?: string, html_text?: string, is_pinned?: boolean } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | No | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 }[] ``` ```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 | — | ```ts theme={null} { text?: string, html_text?: string, is_pinned?: boolean } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | No | — | ```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 | — | ```ts theme={null} { name: string, color?: string, notes?: string, workspace?: string, followers?: string[] } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | No | — | ```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 | — | ```ts theme={null} { name: string, color?: string, notes?: string, followers?: string[] } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | No | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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?: { }[] }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```ts theme={null} { name?: string, color?: string, notes?: string } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | No | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```ts theme={null} { name?: string, include?: string } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | No | — | ```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 | — | ```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 | — | ```ts theme={null} { gid: string, name?: string, resource_type?: string }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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?: { }[] }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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?: { }[] }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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?: { }[] }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { name: string, description?: string, html_description?: string, visibility?: string } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | No | — | ```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 | — | ```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 | — | ```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 }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 | — | ```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 } }[] ``` ```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 | — | ```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 } }[] ``` ```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 | — | ```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 } }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { name?: string, description?: string, html_description?: string, visibility?: string } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | No | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { gid: string, name?: string, email?: string, resource_type?: string, photo?: { } | null, workspaces?: { gid: string, name?: string, resource_type?: string }[] }[] ``` ```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 | — | ```ts theme={null} { gid: string, name?: string, email?: string, resource_type?: string, photo?: { } | null, workspaces?: { gid: string, name?: string, resource_type?: string }[] }[] ``` ```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 | — | ```ts theme={null} { gid: string, name?: string, email?: string, resource_type?: string, photo?: { } | null, workspaces?: { gid: string, name?: string, resource_type?: string }[] }[] ``` ```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 | — | ```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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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[] }[] }[] ``` ```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 | — | ```ts theme={null} { filters?: { resource_type?: string, resource_subtype?: string, action?: string, fields?: string[] }[] } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | No | — | ```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 | — | ```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 | — | ```ts theme={null} { gid: string, name?: string, resource_type?: string, is_organization?: boolean, email_domains?: string[] }[] ``` ```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 | — | ```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 | — | ```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 } }[] ``` ```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 | — | ```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 } }[] ``` ```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. **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 Asana plugin for Corsair Use **Asana** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 84 typed API operations * 7 database entities synced for fast `.search()` / `.list()` queries * 2 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/asana ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { asana } from '@corsair-dev/asana'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [asana()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { asana } from '@corsair-dev/asana'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [asana()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/asana/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=asana ``` Use the key names documented in [Get Credentials](/plugins/asana/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=asana --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} asana() ``` Store credentials with `pnpm corsair setup --plugin=asana` (see [Get Credentials](/plugins/asana/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ```ts corsair.ts theme={null} asana({ authType: 'oauth_2', }) ``` Store credentials with `pnpm corsair setup --plugin=asana` (see [Get Credentials](/plugins/asana/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **2** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/asana/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.asana.db..search()` and `.list()`. See [Database](/plugins/asana/database) for filters and operators. ## Example API calls **Read-style (read):** `projects.get` ```ts theme={null} await corsair.asana.api.projects.get({}); ``` **Write-style (write):** `projects.addFollowers` ```ts theme={null} await corsair.asana.api.projects.addFollowers({}); ``` See the full list on the [API](/plugins/asana/api) page. Use `pnpm corsair list --plugin=asana` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/asana/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------- | | API | [API](/plugins/asana/api) | | Database | [Database](/plugins/asana/database) | | Webhooks | [Webhooks](/plugins/asana/webhooks) | | Credentials | [Get credentials](/plugins/asana/get-credentials) | # 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). **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* ```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 | — | ```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 } }[] ``` ```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/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. **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 | — | ```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 | — | ```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 | — | ```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. **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 Bitwarden plugin for Corsair Use **Bitwarden** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 6 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/bitwarden ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { bitwarden } from '@corsair-dev/bitwarden'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [bitwarden()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { bitwarden } from '@corsair-dev/bitwarden'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [bitwarden()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/bitwarden/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=bitwarden ``` Use the key names documented in [Get Credentials](/plugins/bitwarden/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=bitwarden --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} bitwarden() ``` Store credentials with `pnpm corsair setup --plugin=bitwarden` (see [Get Credentials](/plugins/bitwarden/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Query synced data Synced entities support `corsair.bitwarden.db..search()` and `.list()`. See [Database](/plugins/bitwarden/database) for filters and operators. ## Example API calls **Read-style (read):** `collections.get` ```ts theme={null} await corsair.bitwarden.api.collections.get({}); ``` **Write-style (write):** `—` *No write-style endpoint inferred; pick any operation from the reference below.* See the full list on the [API](/plugins/bitwarden/api) page. Use `pnpm corsair list --plugin=bitwarden` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ----------------------------------------------------- | | API | [API](/plugins/bitwarden/api) | | Database | [Database](/plugins/bitwarden/database) | | Credentials | [Get credentials](/plugins/bitwarden/get-credentials) | # 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. **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 | — | ```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 \[DESTRUCTIVE] **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. **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 Bluesky plugin for Corsair Use **Bluesky** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 4 typed API operations * 1 database entity synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/bluesky ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { bluesky } from '@corsair-dev/bluesky'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [bluesky()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { bluesky } from '@corsair-dev/bluesky'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [bluesky()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/bluesky/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=bluesky ``` Use the key names documented in [Get Credentials](/plugins/bluesky/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=bluesky --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} bluesky() ``` Store credentials with `pnpm corsair setup --plugin=bluesky` (see [Get Credentials](/plugins/bluesky/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.bluesky.db..search()` and `.list()`. See [Database](/plugins/bluesky/database) for filters and operators. ## Example API calls **Read-style (read):** `feeds.getTimeline` ```ts theme={null} await corsair.bluesky.api.feeds.getTimeline({}); ``` **Write-style (write):** `posts.create` ```ts theme={null} await corsair.bluesky.api.posts.create({}); ``` See the full list on the [API](/plugins/bluesky/api) page. Use `pnpm corsair list --plugin=bluesky` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | --------------------------------------------------- | | API | [API](/plugins/bluesky/api) | | Database | [Database](/plugins/bluesky/database) | | Credentials | [Get credentials](/plugins/bluesky/get-credentials) | # 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. **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 | — | ```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 | — | ```ts theme={null} { total_count?: number, entries?: { type?: string, id?: string, sequence_id?: string | null, etag?: string | null, name?: string | null }[] } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```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 } ``` ```ts theme={null} { type?: string, id?: string, sequence_id?: string | null, etag?: string | null, name?: string | null } ``` *** ### delete `files.delete` Delete a Box file \[DESTRUCTIVE] **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 | — | ```ts theme={null} { total_count?: number, entries?: { type?: string, id?: string, sequence_id?: string | null, etag?: string | null, name?: string | null }[] } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```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 } ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { total_count?: number, entries?: { type?: string, id?: string, sequence_id?: string | null, etag?: string | null, name?: string | null }[] } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```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 } ``` ```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 | — | ```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 | — | ```ts theme={null} { total_count?: number, entries?: { type?: string, id?: string, sequence_id?: string | null, etag?: string | null, name?: string | null }[] } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```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 } ``` ```ts theme={null} { type?: string, id?: string, sequence_id?: string | null, etag?: string | null, name?: string | null } ``` ```ts theme={null} { total_count?: number, entries?: { }[] } ``` *** ### delete `folders.delete` Delete a Box folder \[DESTRUCTIVE] **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 | — | ```ts theme={null} { total_count?: number, entries?: { type?: string, id?: string, sequence_id?: string | null, etag?: string | null, name?: string | null }[] } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```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 } ``` ```ts theme={null} { type?: string, id?: string, sequence_id?: string | null, etag?: string | null, name?: string | null } ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { total_count?: number, entries?: { type?: string, id?: string, sequence_id?: string | null, etag?: string | null, name?: string | null }[] } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```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 } ``` ```ts theme={null} { type?: string, id?: string, sequence_id?: string | null, etag?: string | null, name?: string | null } ``` ```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 | — | ```ts theme={null} { total_count?: number, entries?: { type?: string, id?: string, sequence_id?: string | null, etag?: string | null, name?: string | null }[] } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```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 } ``` ```ts theme={null} { type?: string, id?: string, sequence_id?: string | null, etag?: string | null, name?: string | null } ``` ```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. **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 Box plugin for Corsair Use **Box** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 13 typed API operations * 2 database entities synced for fast `.search()` / `.list()` queries * 33 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/box ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { box } from '@corsair-dev/box'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [box()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { box } from '@corsair-dev/box'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [box()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/box/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=box ``` Use the key names documented in [Get Credentials](/plugins/box/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=box --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} box() ``` Store credentials with `pnpm corsair setup --plugin=box` (see [Get Credentials](/plugins/box/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **33** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/box/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.box.db..search()` and `.list()`. See [Database](/plugins/box/database) for filters and operators. ## Example API calls **Read-style (read):** `files.download` ```ts theme={null} await corsair.box.api.files.download({}); ``` **Write-style (write):** `files.copy` ```ts theme={null} await corsair.box.api.files.copy({}); ``` See the full list on the [API](/plugins/box/api) page. Use `pnpm corsair list --plugin=box` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/box/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ----------------------------------------------- | | API | [API](/plugins/box/api) | | Database | [Database](/plugins/box/database) | | Webhooks | [Webhooks](/plugins/box/webhooks) | | Credentials | [Get credentials](/plugins/box/get-credentials) | # 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). **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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { type: webhook, id: string } ``` ```ts theme={null} { type?: string, id?: string, name?: string, login?: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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/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. **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Bookings ### cancel `bookings.cancel` Cancel a booking \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```ts theme={null} { name: string, email: string, timeZone: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | -------- | -------- | -------- | ----------- | | `status` | `string` | Yes | — | | `data` | `object` | No | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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 Cal plugin for Corsair Use **Cal.com** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 7 typed API operations * 1 database entity synced for fast `.search()` / `.list()` queries * 5 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/cal ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { cal } from '@corsair-dev/cal'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [cal()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { cal } from '@corsair-dev/cal'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [cal()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/cal/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=cal ``` Use the key names documented in [Get Credentials](/plugins/cal/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=cal --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} cal() ``` Store credentials with `pnpm corsair setup --plugin=cal` (see [Get Credentials](/plugins/cal/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **5** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/cal/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.cal.db..search()` and `.list()`. See [Database](/plugins/cal/database) for filters and operators. ## Example API calls **Read-style (read):** `bookings.get` ```ts theme={null} await corsair.cal.api.bookings.get({}); ``` **Write-style (destructive):** `bookings.cancel` ```ts theme={null} await corsair.cal.api.bookings.cancel({}); ``` See the full list on the [API](/plugins/cal/api) page. Use `pnpm corsair list --plugin=cal` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/cal/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ----------------------------------------------- | | API | [API](/plugins/cal/api) | | Database | [Database](/plugins/cal/database) | | Webhooks | [Webhooks](/plugins/cal/webhooks) | | Credentials | [Get credentials](/plugins/cal/get-credentials) | # 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). **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 | — | ```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 } ``` ```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 | — | ```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 } ``` ```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 | — | ```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 } ``` ```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 | — | ```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 } ``` ```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 | — | ```ts theme={null} { } ``` ```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. **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 | — | ```ts theme={null} { uri?: string, action: string, actor: { }, details: { }, organization: string, occurred_at: string, namespace?: string }[] ``` ```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 | — | ```ts theme={null} { uri?: string, channel?: string, sent_at?: string, status?: string, to?: string }[] ``` ```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 | — | ```ts theme={null} { type: string, num_days?: number } ``` ```ts theme={null} { kind: string, location?: string, additional_info?: string }[] ``` **Output** | Name | Type | Required | Description | | ---------- | -------- | -------- | ----------- | | `resource` | `object` | Yes | — | ```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 | — | ```ts theme={null} { type: string, start_date?: string, end_date?: string } ``` ```ts theme={null} { kind: string, location?: string } ``` **Output** | Name | Type | Required | Description | | ---------- | -------- | -------- | ----------- | | `resource` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { uri: string, user?: string, user_membership_uri?: string }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { type: string, wday?: string, date?: string, intervals: { from: string, to: string }[] }[] ``` **Output** | Name | Type | Required | Description | | ---------- | -------- | -------- | ----------- | | `resource` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { uri: string, name: string, slug?: string, organization: string, user_count?: number, scheduling_url?: string, created_at?: string, updated_at?: string }[] ``` ```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 | — | ```ts theme={null} { uri: string, type: string, group: string }[] ``` ```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 | — | ```ts theme={null} { email: string }[] ``` ```ts theme={null} { question: string, answer: string, position: number }[] ``` **Output** | Name | Type | Required | Description | | ---------- | -------- | -------- | ----------- | | `resource` | `object` | Yes | — | ```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 \[DESTRUCTIVE] **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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 }[] ``` ```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 | — | ```ts theme={null} { uri: string, invitee: string, created_at: string, updated_at: string } ``` *** ## Organizations ### deleteMembership `organizations.deleteMembership` Delete an organization membership \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { uri: string, organization: string, email: string, status: string, created_at: string, updated_at: string, last_sent_at?: string, user?: string | null }[] ``` ```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 | — | ```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 }[] ``` ```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 \[DESTRUCTIVE] **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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { uri: string, name: string, organization: string, status?: string, created_at?: string, updated_at?: string }[] ``` ```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 \[DESTRUCTIVE] **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 | — | ```ts theme={null} { canceled_by?: string, canceler_type?: string, reason?: string } ``` *** ### deleteData `scheduledEvents.deleteData` Delete all scheduled event data in a time range \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 }[] }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 }[] ``` ```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 | — | ```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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 }[] ``` ```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. **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 Calendly plugin for Corsair Use **Calendly** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 52 typed API operations * 11 database entities synced for fast `.search()` / `.list()` queries * 6 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/calendly ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { calendly } from '@corsair-dev/calendly'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [calendly()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { calendly } from '@corsair-dev/calendly'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [calendly()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/calendly/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=calendly ``` Use the key names documented in [Get Credentials](/plugins/calendly/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=calendly --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} calendly() ``` Store credentials with `pnpm corsair setup --plugin=calendly` (see [Get Credentials](/plugins/calendly/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **6** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/calendly/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.calendly.db..search()` and `.list()`. See [Database](/plugins/calendly/database) for filters and operators. ## Example API calls **Read-style (read):** `activityLog.list` ```ts theme={null} await corsair.calendly.api.activityLog.list({}); ``` **Write-style (write):** `eventTypes.create` ```ts theme={null} await corsair.calendly.api.eventTypes.create({}); ``` See the full list on the [API](/plugins/calendly/api) page. Use `pnpm corsair list --plugin=calendly` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/calendly/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ---------------------------------------------------- | | API | [API](/plugins/calendly/api) | | Database | [Database](/plugins/calendly/database) | | Webhooks | [Webhooks](/plugins/calendly/webhooks) | | Credentials | [Get credentials](/plugins/calendly/get-credentials) | # 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). **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 | — | ```ts theme={null} { uri: string, name?: string, active?: boolean, slug?: string, scheduling_url?: string, duration?: number, kind?: string, color?: string, updated_at?: string } ``` ```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 | — | ```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 } ``` ```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 | — | ```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 } ``` ```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 | — | ```ts theme={null} { uri: string, invitee: string, created_at: string, updated_at: string } ``` ```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 | — | ```ts theme={null} { uri: string, routing_form: string, questions_and_answers?: { }[], tracking?: { }, result?: { }, created_at?: string, updated_at?: string } ``` ```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 | — | ```ts theme={null} { uri: string, name?: string, email?: string, slug?: string, timezone?: string, scheduling_url?: string, updated_at?: string } ``` ```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/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. **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling). ## Assets ### delete `assets.delete` Delete an asset \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ----- | -------- | -------- | ----------- | | `job` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { type: preset, name: doc | email | presentation | whiteboard } | { type: custom, width: number, height: number } ``` **Output** | Name | Type | Required | Description | | -------- | -------- | -------- | ----------- | | `design` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { type: preset, name: doc | email | presentation | whiteboard } | { type: custom, width: number, height: number } ``` **Output** | Name | Type | Required | Description | | ----- | -------- | -------- | ----------- | | `job` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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 Canva plugin for Corsair Use **Canva** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 39 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/canva ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { canva } from '@corsair-dev/canva'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [canva()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { canva } from '@corsair-dev/canva'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [canva()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/canva/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=canva ``` Use the key names documented in [Get Credentials](/plugins/canva/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=canva --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} canva() ``` Store credentials with `pnpm corsair setup --plugin=canva` (see [Get Credentials](/plugins/canva/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Query synced data Synced entities support `corsair.canva.db..search()` and `.list()`. See [Database](/plugins/canva/database) for filters and operators. ## Example API calls **Read-style (read):** `assets.get` ```ts theme={null} await corsair.canva.api.assets.get({}); ``` **Write-style (destructive):** `assets.delete` ```ts theme={null} await corsair.canva.api.assets.delete({}); ``` See the full list on the [API](/plugins/canva/api) page. Use `pnpm corsair list --plugin=canva` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------- | | API | [API](/plugins/canva/api) | | Database | [Database](/plugins/canva/database) | | Credentials | [Get credentials](/plugins/canva/get-credentials) | # 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. **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 \[DESTRUCTIVE] **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[]` ```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 | — | ```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 | — | ```ts theme={null} { }[] ``` *** ### delete `rulesets.delete` Delete a ruleset \[DESTRUCTIVE] **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 | — | ```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[]` ```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 | — | ```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 | — | ```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 \[DESTRUCTIVE] **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[]` ```ts theme={null} { id: string, pattern: string, script?: string }[] ``` *** ### scripts.delete `workers.scripts.delete` Delete a Workers script \[DESTRUCTIVE] **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[]` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { id: string } ``` *** ### delete `zones.delete` Delete a Cloudflare zone \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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[]` ```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. **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 Cloudflare plugin for Corsair Use **Cloudflare** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 24 typed API operations * 5 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/cloudflare ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { cloudflare } from '@corsair-dev/cloudflare'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [cloudflare()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { cloudflare } from '@corsair-dev/cloudflare'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [cloudflare()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/cloudflare/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=cloudflare ``` Use the key names documented in [Get Credentials](/plugins/cloudflare/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=cloudflare --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} cloudflare() ``` Store credentials with `pnpm corsair setup --plugin=cloudflare` (see [Get Credentials](/plugins/cloudflare/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.cloudflare.db..search()` and `.list()`. See [Database](/plugins/cloudflare/database) for filters and operators. ## Example API calls **Read-style (read):** `dns.get` ```ts theme={null} await corsair.cloudflare.api.dns.get({}); ``` **Write-style (write):** `dns.create` ```ts theme={null} await corsair.cloudflare.api.dns.create({}); ``` See the full list on the [API](/plugins/cloudflare/api) page. Use `pnpm corsair list --plugin=cloudflare` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------------ | | API | [API](/plugins/cloudflare/api) | | Database | [Database](/plugins/cloudflare/database) | | Credentials | [Get credentials](/plugins/cloudflare/get-credentials) | # 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. **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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `folders` | `object[]` | No | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `folders` | `object[]` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `folders` | `object[]` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output:** `object[]` ```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 | — | ```ts theme={null} { } ``` **Output:** `object[]` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `mappings` | `object[]` | No | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ----------- | -------- | -------- | ----------- | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `condition` | `object` | No | — | | `result` | `object` | No | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ----------------- | ---------- | -------- | ----------- | | `metadata_fields` | `object[]` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------- | ---------- | -------- | ----------- | | `rules` | `object[]` | No | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ----------- | -------- | -------- | ----------- | | `id` | `string` | Yes | — | | `name` | `string` | No | — | | `condition` | `object` | No | — | | `result` | `object` | No | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ---------- | --------- | -------- | ----------- | | `name` | `string` | Yes | — | | `unsigned` | `boolean` | No | — | | `settings` | `object` | No | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ---------- | --------- | -------- | ----------- | | `name` | `string` | Yes | — | | `unsigned` | `boolean` | No | — | | `settings` | `object` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ---------- | --------- | -------- | ----------- | | `name` | `string` | Yes | — | | `unsigned` | `boolean` | No | — | | `settings` | `object` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `presets` | `object[]` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `folders` | `object[]` | No | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------ | ---------- | -------- | ----------- | | `tags` | `object[]` | No | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ----------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `transformations` | `object[]` | No | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `triggers` | `object[]` | No | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `next_cursor` | `string` | No | — | | `total_count` | `number` | No | — | | `resources` | `object[]` | No | — | ```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. **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 Cloudinary plugin for Corsair Use **Cloudinary** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 110 typed API operations * 10 database entities synced for fast `.search()` / `.list()` queries * 13 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/cloudinary ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { cloudinary } from '@corsair-dev/cloudinary'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [cloudinary()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { cloudinary } from '@corsair-dev/cloudinary'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [cloudinary()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/cloudinary/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=cloudinary ``` Use the key names documented in [Get Credentials](/plugins/cloudinary/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=cloudinary --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication See [Get Credentials](/plugins/cloudinary/get-credentials) for how to obtain and store secrets. Auth methods depend on how you configure `cloudinary({ ... })` — check the plugin source `*PluginOptions` type for supported `authType` values. * [API key authentication](/concepts/api-key) * [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **13** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/cloudinary/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.cloudinary.db..search()` and `.list()`. See [Database](/plugins/cloudinary/database) for filters and operators. ## Example API calls **Read-style (read):** `adaptive.getAdaptiveStreamingProfiles` ```ts theme={null} await corsair.cloudinary.api.adaptive.getAdaptiveStreamingProfiles({}); ``` **Write-style (write):** `asset.createAssetRelationsByAssetId` ```ts theme={null} await corsair.cloudinary.api.asset.createAssetRelationsByAssetId({}); ``` See the full list on the [API](/plugins/cloudinary/api) page. Use `pnpm corsair list --plugin=cloudinary` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/cloudinary/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------------ | | API | [API](/plugins/cloudinary/api) | | Database | [Database](/plugins/cloudinary/database) | | Webhooks | [Webhooks](/plugins/cloudinary/webhooks) | | Credentials | [Get credentials](/plugins/cloudinary/get-credentials) | # 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). **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 | — | ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { path?: string, name?: string } ``` ```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 | — | ```ts theme={null} { path?: string, name?: string } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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/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. **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 | — | ```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 } }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```ts theme={null} { id?: string, ari?: string, key: string, alias?: string, name: string, type?: string, status?: string, description?: any, homepage?: any, _expandable?: { }, _links?: { } }[] ``` ```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. **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 Confluence plugin for Corsair Use **Confluence** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 3 typed API operations ## Setup ```bash theme={null} pnpm install @corsair-dev/confluence ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { confluence } from '@corsair-dev/confluence'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [confluence()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { confluence } from '@corsair-dev/confluence'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [confluence()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/confluence/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=confluence ``` Use the key names documented in [Get Credentials](/plugins/confluence/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=confluence --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} confluence() ``` Store credentials with `pnpm corsair setup --plugin=confluence` (see [Get Credentials](/plugins/confluence/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ```ts corsair.ts theme={null} confluence({ authType: 'oauth_2', }) ``` Store credentials with `pnpm corsair setup --plugin=confluence` (see [Get Credentials](/plugins/confluence/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Example API calls **Read-style (read):** `pages.get` ```ts theme={null} await corsair.confluence.api.pages.get({}); ``` **Write-style (write):** `—` *No write-style endpoint inferred; pick any operation from the reference below.* See the full list on the [API](/plugins/confluence/api) page. Use `pnpm corsair list --plugin=confluence` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------------ | | API | [API](/plugins/confluence/api) | | Credentials | [Get credentials](/plugins/confluence/get-credentials) | # 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. **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 | — | ```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 | — | ```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 | — | ```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. **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 Cursor plugin for Corsair Use **Cursor** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 5 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/cursor ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { cursor } from '@corsair-dev/cursor'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [cursor()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { cursor } from '@corsair-dev/cursor'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [cursor()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/cursor/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=cursor ``` Use the key names documented in [Get Credentials](/plugins/cursor/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=cursor --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} cursor() ``` Store credentials with `pnpm corsair setup --plugin=cursor` (see [Get Credentials](/plugins/cursor/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.cursor.db..search()` and `.list()`. See [Database](/plugins/cursor/database) for filters and operators. ## Example API calls **Read-style (read):** `account.getMe` ```ts theme={null} await corsair.cursor.api.account.getMe({}); ``` **Write-style (write):** `—` *No write-style endpoint inferred; pick any operation from the reference below.* See the full list on the [API](/plugins/cursor/api) page. Use `pnpm corsair list --plugin=cursor` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | -------------------------------------------------- | | API | [API](/plugins/cursor/api) | | Database | [Database](/plugins/cursor/database) | | Credentials | [Get credentials](/plugins/cursor/get-credentials) | # 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. **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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { role_arn: string } ``` ```ts theme={null} { directory_id: string, application_id: string, client_secret: string } ``` ```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 | — | ```ts theme={null} { role_arn: string } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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 Databricks plugin for Corsair Use **Databricks** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 130 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/databricks ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { databricks } from '@corsair-dev/databricks'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [databricks()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { databricks } from '@corsair-dev/databricks'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [databricks()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/databricks/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=databricks ``` Use the key names documented in [Get Credentials](/plugins/databricks/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=databricks --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} databricks() ``` Store credentials with `pnpm corsair setup --plugin=databricks` (see [Get Credentials](/plugins/databricks/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ```ts corsair.ts theme={null} databricks({ authType: 'oauth_2', }) ``` Store credentials with `pnpm corsair setup --plugin=databricks` (see [Get Credentials](/plugins/databricks/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Query synced data Synced entities support `corsair.databricks.db..search()` and `.list()`. See [Database](/plugins/databricks/database) for filters and operators. ## Example API calls **Read-style (read):** `catalog.checkTableExists` ```ts theme={null} await corsair.databricks.api.catalog.checkTableExists({}); ``` **Write-style (write):** `apps.createDatabricksApp` ```ts theme={null} await corsair.databricks.api.apps.createDatabricksApp({}); ``` See the full list on the [API](/plugins/databricks/api) page. Use `pnpm corsair list --plugin=databricks` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------------ | | API | [API](/plugins/databricks/api) | | Database | [Database](/plugins/databricks/database) | | Credentials | [Get credentials](/plugins/databricks/get-credentials) | # 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. **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 | — | ```ts theme={null} { id?: string, type?: string, attributes?: { }, relationships?: { } }[] ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { id?: number, definition: { }, layout?: { x: number, y: number, width: number, height: number } }[] ``` ```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 | — | ```ts theme={null} { id?: number, definition: { }, layout?: { x: number, y: number, width: number, height: number } }[] ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { id?: number, definition: { }, layout?: { x: number, y: number, width: number, height: number } }[] ``` ```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 | — | ```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` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { id?: string, type?: string, attributes?: { }, relationships?: { } }[] ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { id?: string, type?: string, attributes?: { } }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { name?: string | null, email?: string, handle?: string } ``` ```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 | — | ```ts theme={null} { name?: string | null, email?: string, handle?: string } ``` ```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[]` ```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 | — | ```ts theme={null} { name?: string | null, email?: string, handle?: string } ``` ```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 | — | ```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?: { } }[] ``` ```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 | — | ```ts theme={null} { name?: string | null, email?: string, handle?: string } ``` ```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 | — | ```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 | — | ```ts theme={null} { name?: string | null, email?: string, handle?: string } ``` ```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 | — | ```ts theme={null} { id?: string, type?: string, attributes?: { }, relationships?: { } }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { timeframe: string, target: number, warning?: number }[] ``` ```ts theme={null} { numerator: string, denominator: string } ``` **Output** | Name | Type | Required | Description | | ------- | ---------- | -------- | ----------- | | `data` | `object[]` | No | — | | `error` | `string` | No | — | ```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 | — | ```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 }[] ``` ```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 | — | ```ts theme={null} { type?: string, attributes?: { } } | { }[] ``` ```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` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { id?: string, type?: string, attributes?: { }, relationships?: { } }[] ``` ```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. **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 Datadog plugin for Corsair Use **Datadog** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 45 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/datadog ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { datadog } from '@corsair-dev/datadog'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [datadog()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { datadog } from '@corsair-dev/datadog'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [datadog()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/datadog/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=datadog ``` Use the key names documented in [Get Credentials](/plugins/datadog/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=datadog --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} datadog() ``` Store credentials with `pnpm corsair setup --plugin=datadog` (see [Get Credentials](/plugins/datadog/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.datadog.db..search()` and `.list()`. See [Database](/plugins/datadog/database) for filters and operators. ## Example API calls **Read-style (read):** `apiKeys.list` ```ts theme={null} await corsair.datadog.api.apiKeys.list({}); ``` **Write-style (write):** `dashboards.create` ```ts theme={null} await corsair.datadog.api.dashboards.create({}); ``` See the full list on the [API](/plugins/datadog/api) page. Use `pnpm corsair list --plugin=datadog` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | --------------------------------------------------- | | API | [API](/plugins/datadog/api) | | Database | [Database](/plugins/datadog/database) | | Credentials | [Get credentials](/plugins/datadog/get-credentials) | # 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. **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 | — | ```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 } )[] }[] ``` ```ts theme={null} string | { type: text, text: string }[] ``` ```ts theme={null} { name: string, description?: string, input_schema: { } }[] ``` ```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 } ``` ```ts theme={null} { type: enabled, budget_tokens: number } | { type: disabled } ``` ```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 | — | ```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 } )[] ``` ```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 | — | ```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 }[] ``` ```ts theme={null} { type: text } | { type: json_object } ``` ```ts theme={null} { type: function, function: { name: string, description?: string, parameters?: { } } }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 | — | ```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. **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 Deepseek plugin for Corsair Use **Deepseek** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 4 typed API operations ## Setup ```bash theme={null} pnpm install @corsair-dev/deepseek ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { deepseek } from '@corsair-dev/deepseek'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [deepseek()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { deepseek } from '@corsair-dev/deepseek'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [deepseek()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/deepseek/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=deepseek ``` Use the key names documented in [Get Credentials](/plugins/deepseek/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=deepseek --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} deepseek() ``` Store credentials with `pnpm corsair setup --plugin=deepseek` (see [Get Credentials](/plugins/deepseek/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Example API calls **Read-style (read):** `models.list` ```ts theme={null} await corsair.deepseek.api.models.list({}); ``` **Write-style (write):** `anthropic.createMessage` ```ts theme={null} await corsair.deepseek.api.anthropic.createMessage({}); ``` See the full list on the [API](/plugins/deepseek/api) page. Use `pnpm corsair list --plugin=deepseek` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ---------------------------------------------------- | | API | [API](/plugins/deepseek/api) | | Credentials | [Get credentials](/plugins/deepseek/get-credentials) | # 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. **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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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. **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 DigitalOcean plugin for Corsair Use **DigitalOcean** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 47 typed API operations * 3 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/digitalocean ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { digitalocean } from '@corsair-dev/digitalocean'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [digitalocean()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { digitalocean } from '@corsair-dev/digitalocean'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [digitalocean()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/digitalocean/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=digitalocean ``` Use the key names documented in [Get Credentials](/plugins/digitalocean/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=digitalocean --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} digitalocean() ``` Store credentials with `pnpm corsair setup --plugin=digitalocean` (see [Get Credentials](/plugins/digitalocean/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.digitalocean.db..search()` and `.list()`. See [Database](/plugins/digitalocean/database) for filters and operators. ## Example API calls **Read-style (read):** `databases.listAllDatabases` ```ts theme={null} await corsair.digitalocean.api.databases.listAllDatabases({}); ``` **Write-style (write):** `databases.createDatabaseCluster` ```ts theme={null} await corsair.digitalocean.api.databases.createDatabaseCluster({}); ``` See the full list on the [API](/plugins/digitalocean/api) page. Use `pnpm corsair list --plugin=digitalocean` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | -------------------------------------------------------- | | API | [API](/plugins/digitalocean/api) | | Database | [Database](/plugins/digitalocean/database) | | Credentials | [Get credentials](/plugins/digitalocean/get-credentials) | # 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. **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[]` ```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 | — | ```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[]` ```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 | — | ```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[]` ```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 \[DESTRUCTIVE] **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 | — | ```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 }[] ``` **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 | — | | `message_reference` | `object` | No | — | | `thread` | `object` | No | — | | `nonce` | `string \| number` | No | — | | `referenced_message` | `lazy` | Yes | — | ```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 } ``` ```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 }[] ``` ```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 }[] ``` ```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 }[] ``` ```ts theme={null} { count: number, me: boolean, emoji: { id?: string | null, name: string } }[] ``` ```ts theme={null} { message_id?: string, channel_id?: string, guild_id?: string } ``` ```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 | — | | `message_reference` | `object` | No | — | | `thread` | `object` | No | — | | `nonce` | `string \| number` | No | — | | `referenced_message` | `lazy` | Yes | — | ```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 } ``` ```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 }[] ``` ```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 }[] ``` ```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 }[] ``` ```ts theme={null} { count: number, me: boolean, emoji: { id?: string | null, name: string } }[] ``` ```ts theme={null} { message_id?: string, channel_id?: string, guild_id?: string } ``` ```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[]` ```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, 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 | — | | `fail_if_not_exists` | `boolean` | No | — | ```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 }[] ``` **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 | — | | `message_reference` | `object` | No | — | | `thread` | `object` | No | — | | `nonce` | `string \| number` | No | — | | `referenced_message` | `lazy` | Yes | — | ```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 } ``` ```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 }[] ``` ```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 }[] ``` ```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 }[] ``` ```ts theme={null} { count: number, me: boolean, emoji: { id?: string | null, name: string } }[] ``` ```ts theme={null} { message_id?: string, channel_id?: string, guild_id?: string } ``` ```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 | — | | `tts` | `boolean` | No | — | | `nonce` | `string \| number` | No | — | ```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 }[] ``` **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 | — | | `message_reference` | `object` | No | — | | `thread` | `object` | No | — | | `nonce` | `string \| number` | No | — | | `referenced_message` | `lazy` | Yes | — | ```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 } ``` ```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 }[] ``` ```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 }[] ``` ```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 }[] ``` ```ts theme={null} { count: number, me: boolean, emoji: { id?: string | null, name: string } }[] ``` ```ts theme={null} { message_id?: string, channel_id?: string, guild_id?: string } ``` ```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[]` ```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 | — | ```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 | — | ```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. **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 Discord plugin for Corsair Use **Discord** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 16 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries * 4 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/discord ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { discord } from '@corsair-dev/discord'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [discord()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { discord } from '@corsair-dev/discord'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [discord()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/discord/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=discord ``` Use the key names documented in [Get Credentials](/plugins/discord/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=discord --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} discord() ``` Store credentials with `pnpm corsair setup --plugin=discord` (see [Get Credentials](/plugins/discord/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **4** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/discord/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.discord.db..search()` and `.list()`. See [Database](/plugins/discord/database) for filters and operators. ## Example API calls **Read-style (read):** `channels.list` ```ts theme={null} await corsair.discord.api.channels.list({}); ``` **Write-style (destructive):** `messages.delete` ```ts theme={null} await corsair.discord.api.messages.delete({}); ``` See the full list on the [API](/plugins/discord/api) page. Use `pnpm corsair list --plugin=discord` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/discord/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | --------------------------------------------------- | | API | [API](/plugins/discord/api) | | Database | [Database](/plugins/discord/database) | | Webhooks | [Webhooks](/plugins/discord/webhooks) | | Credentials | [Get credentials](/plugins/discord/get-credentials) | # 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). **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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { custom_id: string, component_type: number, values?: string[] } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { custom_id: string, components: { type: number, components: { type: number, custom_id: string, value: string }[] }[] } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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/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. **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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 DodoPayments plugin for Corsair Use **Dodo Payments** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 9 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries * 5 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/dodopayments ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { dodopayments } from '@corsair-dev/dodopayments'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [dodopayments()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { dodopayments } from '@corsair-dev/dodopayments'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [dodopayments()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/dodopayments/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=dodopayments ``` Use the key names documented in [Get Credentials](/plugins/dodopayments/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=dodopayments --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} dodopayments() ``` Store credentials with `pnpm corsair setup --plugin=dodopayments` (see [Get Credentials](/plugins/dodopayments/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **5** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/dodopayments/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.dodopayments.db..search()` and `.list()`. See [Database](/plugins/dodopayments/database) for filters and operators. ## Example API calls **Read-style (read):** `customers.get` ```ts theme={null} await corsair.dodopayments.api.customers.get({}); ``` **Write-style (write):** `customers.create` ```ts theme={null} await corsair.dodopayments.api.customers.create({}); ``` See the full list on the [API](/plugins/dodopayments/api) page. Use `pnpm corsair list --plugin=dodopayments` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/dodopayments/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | -------------------------------------------------------- | | API | [API](/plugins/dodopayments/api) | | Database | [Database](/plugins/dodopayments/database) | | Webhooks | [Webhooks](/plugins/dodopayments/webhooks) | | Credentials | [Get credentials](/plugins/dodopayments/get-credentials) | # 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). **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 | — | ```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 } ``` ```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 | — | ```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 } ``` ```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 | — | ```ts theme={null} { id: string, payment_id: string, amount: number, status: string, reason?: string | null, created_at?: string } ``` ```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 | — | ```ts theme={null} { id: string, customer_id: string, plan_id?: string | null, status: string, billing_cycle?: { } | null, created_at?: string } ``` ```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 | — | ```ts theme={null} { id: string, customer_id: string, plan_id?: string | null, status: string, billing_cycle?: { } | null, created_at?: string } ``` ```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/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. **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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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 Dropbox plugin for Corsair Use **Dropbox** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 12 typed API operations * 2 database entities synced for fast `.search()` / `.list()` queries * 1 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/dropbox ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { dropbox } from '@corsair-dev/dropbox'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [dropbox()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { dropbox } from '@corsair-dev/dropbox'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [dropbox()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/dropbox/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=dropbox ``` Use the key names documented in [Get Credentials](/plugins/dropbox/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=dropbox --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} dropbox() ``` Store credentials with `pnpm corsair setup --plugin=dropbox` (see [Get Credentials](/plugins/dropbox/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **1** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/dropbox/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.dropbox.db..search()` and `.list()`. See [Database](/plugins/dropbox/database) for filters and operators. ## Example API calls **Read-style (read):** `files.download` ```ts theme={null} await corsair.dropbox.api.files.download({}); ``` **Write-style (write):** `files.copy` ```ts theme={null} await corsair.dropbox.api.files.copy({}); ``` See the full list on the [API](/plugins/dropbox/api) page. Use `pnpm corsair list --plugin=dropbox` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/dropbox/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | --------------------------------------------------- | | API | [API](/plugins/dropbox/api) | | Database | [Database](/plugins/dropbox/database) | | Webhooks | [Webhooks](/plugins/dropbox/webhooks) | | Credentials | [Get credentials](/plugins/dropbox/get-credentials) | # 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). **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 | — | ```ts theme={null} { users: number[] } ``` ```ts theme={null} { accounts: string[] } ``` ```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/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. **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 | — | ```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 | — | ```ts theme={null} { maxCharacters?: number, includeHtmlTags?: boolean } | boolean ``` ```ts theme={null} { numSentences?: number, highlightsPerUrl?: number, query?: string } | boolean ``` ```ts theme={null} { query?: string } | boolean ``` **Output** | Name | Type | Required | Description | | ----------- | ---------- | -------- | ----------- | | `results` | `object[]` | Yes | — | | `requestId` | `string` | No | — | ```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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 }[] }[] ``` ```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 | — | ```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 }[] }[] ``` ```ts theme={null} { id: string, description: string, format: text | date | number | options | boolean, options?: string[], createdAt: string, updatedAt: string }[] ``` ```ts theme={null} { id: string, object: import, websetId: string, urls?: string[], status?: pending | processing | completed | failed, createdAt: string, updatedAt?: string }[] ``` ```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 \[DESTRUCTIVE] **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 | — | ```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 }[] }[] ``` ```ts theme={null} { id: string, description: string, format: text | date | number | options | boolean, options?: string[], createdAt: string, updatedAt: string }[] ``` ```ts theme={null} { id: string, object: import, websetId: string, urls?: string[], status?: pending | processing | completed | failed, createdAt: string, updatedAt?: string }[] ``` ```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. **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 Exa plugin for Corsair Use **Exa** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 14 typed API operations * 6 database entities synced for fast `.search()` / `.list()` queries * 4 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/exa ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { exa } from '@corsair-dev/exa'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [exa()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { exa } from '@corsair-dev/exa'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [exa()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/exa/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=exa ``` Use the key names documented in [Get Credentials](/plugins/exa/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=exa --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} exa() ``` Store credentials with `pnpm corsair setup --plugin=exa` (see [Get Credentials](/plugins/exa/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **4** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/exa/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.exa.db..search()` and `.list()`. See [Database](/plugins/exa/database) for filters and operators. ## Example API calls **Read-style (read):** `answer.get` ```ts theme={null} await corsair.exa.api.answer.get({}); ``` **Write-style (write):** `imports.create` ```ts theme={null} await corsair.exa.api.imports.create({}); ``` See the full list on the [API](/plugins/exa/api) page. Use `pnpm corsair list --plugin=exa` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/exa/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ----------------------------------------------- | | API | [API](/plugins/exa/api) | | Database | [Database](/plugins/exa/database) | | Webhooks | [Webhooks](/plugins/exa/webhooks) | | Credentials | [Get credentials](/plugins/exa/get-credentials) | # 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). **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 | — | ```ts theme={null} { url: string, title?: string | null, publishedDate?: string | null, author?: string | null } ``` ```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 | — | ```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 }[] } ``` ```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 | — | ```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 } ``` ```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 | — | ```ts theme={null} { webset: { id: string, object: webset, status: idle | running | paused | done, externalId?: string, createdAt: string, updatedAt: string }, totalItems?: number } ``` ```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/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. **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 | — | ```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 | — | ```ts theme={null} { id: string, message?: string, created_time?: string, from?: { id?: string, name?: string }, is_hidden?: boolean, like_count?: number, comment_count?: number }[] ``` ```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 | — | ```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?: { }[] } }[] ``` ```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 | — | ```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 }[] } }[] ``` ```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 | — | ```ts theme={null} { id?: string, name?: string, email?: string } ``` ```ts theme={null} { data?: { id?: string, name?: string, email?: string }[] } ``` ```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 | — | ```ts theme={null} { id?: string, name?: string }[] ``` ```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 | — | ```ts theme={null} { name: string, period?: string, values?: { value: number | string | { }, end_time?: string }[], title?: string, description?: string, id?: string }[] ``` ```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 | — | ```ts theme={null} { id?: string, name?: string, tasks?: string[], role?: string }[] ``` ```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 | — | ```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 } } }[] ``` ```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 | — | ```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 } } }[] ``` ```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 | — | ```ts theme={null} { id: string, name?: string, created_time?: string, source?: string, link?: string, images?: { height?: number, width?: number, source?: string }[] }[] ``` ```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 | — | ```ts theme={null} { url: string, caption?: string, published?: boolean }[] ``` **Output:** `object[]` ```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 | — | ```ts theme={null} { media_fbid: string }[] ``` ```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 | — | ```ts theme={null} { name: string, period?: string, values?: { value: number | string | { }, end_time?: string }[], title?: string, description?: string, id?: string }[] ``` ```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 | — | ```ts theme={null} { id?: string, name?: string, type?: string }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 } } }[] ``` ```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 | — | ```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 } }[] ``` ```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. **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 Facebook plugin for Corsair Use **Facebook** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 44 typed API operations * 12 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/facebook ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { facebook } from '@corsair-dev/facebook'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [facebook()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { facebook } from '@corsair-dev/facebook'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [facebook()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/facebook/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=facebook ``` Use the key names documented in [Get Credentials](/plugins/facebook/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=facebook --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} facebook() ``` Store credentials with `pnpm corsair setup --plugin=facebook` (see [Get Credentials](/plugins/facebook/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Query synced data Synced entities support `corsair.facebook.db..search()` and `.list()`. See [Database](/plugins/facebook/database) for filters and operators. ## Example API calls **Read-style (read):** `comments.get` ```ts theme={null} await corsair.facebook.api.comments.get({}); ``` **Write-style (write):** `comments.create` ```ts theme={null} await corsair.facebook.api.comments.create({}); ``` See the full list on the [API](/plugins/facebook/api) page. Use `pnpm corsair list --plugin=facebook` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ---------------------------------------------------- | | API | [API](/plugins/facebook/api) | | Database | [Database](/plugins/facebook/database) | | Credentials | [Get credentials](/plugins/facebook/get-credentials) | # 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. **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 | — | ```ts theme={null} { user?: { id: string, handle?: string, img_url?: string }, emoji?: string, created_at?: string }[] ``` ```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 \[DESTRUCTIVE] **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 | — | ```ts theme={null} { user?: { id: string, handle?: string, img_url?: string }, emoji?: string, created_at?: string }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { node_id: string }[] ``` **Output** | Name | Type | Required | Description | | -------- | -------- | -------- | ----------- | | `images` | `object` | No | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { id: string, url: string, name: string, node_id: string, file_key: string }[] ``` ```ts theme={null} { error: string, node_id?: string, file_key?: string }[] ``` *** ### delete `devResources.delete` Delete a dev resource from a Figma file \[DESTRUCTIVE] **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 | — | ```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 | — | ```ts theme={null} { id: string, url?: string, name?: string }[] ``` **Output** | Name | Type | Required | Description | | --------------- | ---------- | -------- | ----------- | | `links_updated` | `object[]` | No | — | | `errors` | `object[]` | No | — | ```ts theme={null} { id: string, url?: string, name?: string }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { id: string, created_at?: string, label?: string | null, description?: string | null, user?: { id: string, handle?: string, img_url?: string } }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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. **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 Figma plugin for Corsair Use **Figma** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 50 typed API operations * 5 database entities synced for fast `.search()` / `.list()` queries * 6 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/figma ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { figma } from '@corsair-dev/figma'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [figma()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { figma } from '@corsair-dev/figma'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [figma()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/figma/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=figma ``` Use the key names documented in [Get Credentials](/plugins/figma/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=figma --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} figma() ``` Store credentials with `pnpm corsair setup --plugin=figma` (see [Get Credentials](/plugins/figma/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **6** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/figma/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.figma.db..search()` and `.list()`. See [Database](/plugins/figma/database) for filters and operators. ## Example API calls **Read-style (read):** `activityLogs.list` ```ts theme={null} await corsair.figma.api.activityLogs.list({}); ``` **Write-style (write):** `comments.add` ```ts theme={null} await corsair.figma.api.comments.add({}); ``` See the full list on the [API](/plugins/figma/api) page. Use `pnpm corsair list --plugin=figma` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/figma/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------- | | API | [API](/plugins/figma/api) | | Database | [Database](/plugins/figma/database) | | Webhooks | [Webhooks](/plugins/figma/webhooks) | | Credentials | [Get credentials](/plugins/figma/get-credentials) | # 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). **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/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. **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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { url: string, headers?: { }, metadata?: { }, events?: completed | page | failed | started[] } ``` ```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 | — | ```ts theme={null} { country?: string, languages?: string[] } ``` **Output** | Name | Type | Required | Description | | --------- | ---------- | -------- | ----------- | | `success` | `boolean` | Yes | — | | `links` | `object[]` | No | — | ```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 | — | ```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 } )[] ``` ```ts theme={null} { } ``` ```ts theme={null} { type: pdf, mode?: fast | auto | ocr, maxPages?: number }[] ``` ```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 } )[] ``` ```ts theme={null} { country?: string, languages?: string[] } ``` ```ts theme={null} { name: string, saveChanges?: boolean } ``` **Output** | Name | Type | Required | Description | | --------- | --------- | -------- | ----------- | | `success` | `boolean` | Yes | — | | `data` | `object` | No | — | ```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 | — | ```ts theme={null} ( { type: web, tbs?: string, location?: string } | { type: images } | { type: news } )[] ``` ```ts theme={null} ( { type: github } | { type: research } | { type: pdf } )[] ``` ```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 | — | ```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. **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 Firecrawl plugin for Corsair Use **Firecrawl** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 9 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries * 14 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/firecrawl ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { firecrawl } from '@corsair-dev/firecrawl'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [firecrawl()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { firecrawl } from '@corsair-dev/firecrawl'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [firecrawl()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/firecrawl/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=firecrawl ``` Use the key names documented in [Get Credentials](/plugins/firecrawl/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=firecrawl --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} firecrawl() ``` Store credentials with `pnpm corsair setup --plugin=firecrawl` (see [Get Credentials](/plugins/firecrawl/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **14** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/firecrawl/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.firecrawl.db..search()` and `.list()`. See [Database](/plugins/firecrawl/database) for filters and operators. ## Example API calls **Read-style (read):** `agent.get` ```ts theme={null} await corsair.firecrawl.api.agent.get({}); ``` **Write-style (write):** `agent.cancel` ```ts theme={null} await corsair.firecrawl.api.agent.cancel({}); ``` See the full list on the [API](/plugins/firecrawl/api) page. Use `pnpm corsair list --plugin=firecrawl` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/firecrawl/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ----------------------------------------------------- | | API | [API](/plugins/firecrawl/api) | | Database | [Database](/plugins/firecrawl/database) | | Webhooks | [Webhooks](/plugins/firecrawl/webhooks) | | Credentials | [Get credentials](/plugins/firecrawl/get-credentials) | # 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). **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 | — | ```ts theme={null} { creditsUsed?: number, action?: string, input?: { } }[] ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { creditsUsed?: number }[] ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { creditsUsed?: number, data?: { } }[] ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { creditsUsed?: number }[] ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 } }[] ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 } }[] ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { success: boolean, data: { }, extractId: string, llmUsage?: number, totalUrlsScraped?: number, sources?: { } }[] ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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: 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. **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 | — | ```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 | — | ```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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 local sync: searchable entities, `.search()` filters, and operators. The Fireflies plugin syncs data locally. Use `corsair.fireflies.db..search({ data, limit?, offset? })` with the filters listed per entity. **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 Fireflies plugin for Corsair Use **Fireflies** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 15 typed API operations * 3 database entities synced for fast `.search()` / `.list()` queries * 5 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/fireflies ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { fireflies } from '@corsair-dev/fireflies'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [fireflies()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { fireflies } from '@corsair-dev/fireflies'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [fireflies()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/fireflies/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=fireflies ``` Use the key names documented in [Get Credentials](/plugins/fireflies/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=fireflies --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} fireflies() ``` Store credentials with `pnpm corsair setup --plugin=fireflies` (see [Get Credentials](/plugins/fireflies/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **5** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/fireflies/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.fireflies.db..search()` and `.list()`. See [Database](/plugins/fireflies/database) for filters and operators. ## Example API calls **Read-style (read):** `aiApp.getOutputs` ```ts theme={null} await corsair.fireflies.api.aiApp.getOutputs({}); ``` **Write-style (write):** `askFred.continueThread` ```ts theme={null} await corsair.fireflies.api.askFred.continueThread({}); ``` See the full list on the [API](/plugins/fireflies/api) page. Use `pnpm corsair list --plugin=fireflies` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/fireflies/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ----------------------------------------------------- | | API | [API](/plugins/fireflies/api) | | Database | [Database](/plugins/fireflies/database) | | Webhooks | [Webhooks](/plugins/fireflies/webhooks) | | Credentials | [Get credentials](/plugins/fireflies/get-credentials) | # Webhooks Source: https://docs.corsair.dev/plugins/fireflies/webhooks Fireflies incoming webhooks: event paths, payloads, and response data. The Fireflies 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). **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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/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. **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 | ```ts theme={null} { role?: user | model, parts: { text?: string, 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 | ```ts theme={null} { role?: user | model, parts: { text?: string, inlineData?: { mimeType: string, data: string } }[] } ``` **Output** | Name | Type | Required | Description | | ----------- | -------- | -------- | ----------- | | `embedding` | `object` | Yes | — | ```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 | | `generationConfig` | `object` | No | — | | `safetySettings` | `object[]` | No | — | | `systemInstruction` | `object` | No | — | ```ts theme={null} { role?: user | model, parts: { text?: string, inlineData?: { mimeType: string, data: string } }[] }[] ``` ```ts theme={null} { temperature?: number, topP?: number, topK?: number, candidateCount?: number, maxOutputTokens?: number, stopSequences?: string[], responseModalities?: TEXT | IMAGE | AUDIO[] } ``` ```ts theme={null} { category: string, threshold: string }[] ``` ```ts theme={null} { role?: user | model, parts: { text?: string, inlineData?: { mimeType: string, data: string } }[] } ``` **Output** | Name | Type | Required | Description | | --------------- | ---------- | -------- | -------------------------------------------------------------------------- | | `candidates` | `object[]` | No | — | | `usageMetadata` | `object` | No | — | | `text` | `string` | No | Convenience field: first candidate text with markdown code fences stripped | ```ts theme={null} { content?: { role?: user | model, parts: { text?: string, inlineData?: { mimeType: string, data: string } }[] }, finishReason?: string, index?: number, safetyRatings?: any[] }[] ``` ```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 | — | ```ts theme={null} { mimeType: string, data: string }[] ``` ```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 | — | ```ts theme={null} { mimeType: string, contentBase64: string }[] ``` ```ts theme={null} { content?: { role?: user | model, parts: { text?: string, inlineData?: { mimeType: string, data: string } }[] }, finishReason?: string, index?: number, safetyRatings?: any[] }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { bytesBase64Encoded: string, mimeType: string } ``` ```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 | — | ```ts theme={null} { code?: number, message?: string } ``` ```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 | — | ```ts theme={null} { video_file?: { mimeType: string, contentBase64: string } } ``` ```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. **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 Gemini plugin for Corsair Use **Gemini** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 8 typed API operations ## Setup ```bash theme={null} pnpm install @corsair-dev/gemini ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { gemini } from '@corsair-dev/gemini'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [gemini()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { gemini } from '@corsair-dev/gemini'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [gemini()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/gemini/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=gemini ``` Use the key names documented in [Get Credentials](/plugins/gemini/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=gemini --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} gemini() ``` Store credentials with `pnpm corsair setup --plugin=gemini` (see [Get Credentials](/plugins/gemini/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Example API calls **Read-style (read):** `content.countTokens` ```ts theme={null} await corsair.gemini.api.content.countTokens({}); ``` **Write-style (write):** `images.generateImage` ```ts theme={null} await corsair.gemini.api.images.generateImage({}); ``` See the full list on the [API](/plugins/gemini/api) page. Use `pnpm corsair list --plugin=gemini` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | -------------------------------------------------- | | API | [API](/plugins/gemini/api) | | Credentials | [Get credentials](/plugins/gemini/get-credentials) | # 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. **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[]` ```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[]` ```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 | — | ```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[]` ```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[]` ```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[]` ```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[]` ```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[]` ```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[]` ```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[]` ```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[]` ```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[]` ```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[]` ```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 ### 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[]` ```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 | — | ```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 | — | ```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 } ``` ```ts theme={null} ( string | { id?: number, nodeId?: string, url?: string, name?: string, description?: string | null, color?: string | null, default?: boolean } )[] ``` ```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 } ``` ```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 | — | ```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 | — | ```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 } ``` ```ts theme={null} ( string | { id?: number, nodeId?: string, url?: string, name?: string, description?: string | null, color?: string | null, default?: boolean } )[] ``` ```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 } ``` ```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[]` ```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 | — | ```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 | — | ```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 } ``` ```ts theme={null} ( string | { id?: number, nodeId?: string, url?: string, name?: string, description?: string | null, color?: string | null, default?: boolean } )[] ``` ```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 } ``` ```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 | — | ```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 | — | ```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 | — | ```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 } ``` ```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 } ``` ```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 }[] ``` ```ts theme={null} { id?: number, nodeId?: string, url?: string, name?: string, description?: string | null, color?: string | null, default?: boolean }[] ``` ```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 } ``` ```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 } ``` ```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[]` ```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[]` ```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 | — | ```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 } ``` ```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 | — | ```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 } ``` ```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[]` ```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 | — | ```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 } ``` ```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 | — | ```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[]` ```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[]` ```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[]` ```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[]` ```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[]` ```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[]` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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[]` ```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 | — | ```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 | — | ```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 | — | ```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. **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 Github plugin for Corsair Use **Github** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 52 typed API operations * 11 database entities synced for fast `.search()` / `.list()` queries * 100 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/github ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { github } from '@corsair-dev/github'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [github()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { github } from '@corsair-dev/github'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [github()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/github/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=github ``` Use the key names documented in [Get Credentials](/plugins/github/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=github --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} github() ``` Store credentials with `pnpm corsair setup --plugin=github` (see [Get Credentials](/plugins/github/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ```ts corsair.ts theme={null} github({ authType: 'oauth_2', }) ``` Store credentials with `pnpm corsair setup --plugin=github` (see [Get Credentials](/plugins/github/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **100** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/github/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.github.db..search()` and `.list()`. See [Database](/plugins/github/database) for filters and operators. ## Example API calls **Read-style (read):** `comments.get` ```ts theme={null} await corsair.github.api.comments.get({}); ``` **Write-style (write):** `comments.delete` ```ts theme={null} await corsair.github.api.comments.delete({}); ``` See the full list on the [API](/plugins/github/api) page. Use `pnpm corsair list --plugin=github` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/github/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | -------------------------------------------------- | | API | [API](/plugins/github/api) | | Database | [Database](/plugins/github/database) | | Webhooks | [Webhooks](/plugins/github/webhooks) | | Credentials | [Get credentials](/plugins/github/get-credentials) | # 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). **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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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[] } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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[] } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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[] } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } ``` ```ts theme={null} { body?: { from: string } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```ts theme={null} { } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { body?: { from: string } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```ts theme={null} { title?: { from: string }, body?: { from: string } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```ts theme={null} { id: number, node_id: string, url: string, name: string, color: string, default: boolean, description?: string | null } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```ts theme={null} { id: number, node_id: string, url: string, name: string, color: string, default: boolean, description?: string | null } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```ts theme={null} { id: number, node_id: string, url: string, name: string, color: string, default: boolean, description?: string | null } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```ts theme={null} { id: number, node_id: string, url: string, name: string, color: string, default: boolean, description?: string | null } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```ts theme={null} { id: number, node_id: string, url: string, name: string, color: string, default: boolean, description?: string | null } ``` ```ts theme={null} { name?: { from: string }, color?: { from: string }, description?: { from: string } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```ts theme={null} { } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```ts theme={null} { } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```ts theme={null} { id: number, node_id: string, url: string, name: string, color: string, default: boolean, description?: string | null } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```ts theme={null} { id: number, node_id: string, url: string, name: string, color: string, default: boolean, description?: string | null } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { body?: { from: string } } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```ts theme={null} { body?: { from: string } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 }[] } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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 }[] } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 } ``` ```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 | — | ```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[] }[] ``` ```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[] } ``` ```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 } ``` ```ts theme={null} { name: string, email?: string | null, username?: string, date?: string } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```ts theme={null} { } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```ts theme={null} { repository?: { name: { from: string } } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } } } } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```ts theme={null} { } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 } ``` ```ts theme={null} { id: number, node_id: string } ``` ```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 } ``` ```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. **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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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[]` ```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 | — | ```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[]` ```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[]` ```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[]` ```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[]` ```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 | — | ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string }[] ``` ```ts theme={null} { id: number, iid?: number, title: string, state?: string, due_date?: string | null } ``` ```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 | — | ```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 | — | ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string }[] ``` ```ts theme={null} { id: number, iid?: number, title: string, state?: string, due_date?: string | null } ``` ```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[]` ```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[]` ```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 | — | ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string }[] ``` ```ts theme={null} { id: number, iid?: number, title: string, state?: string, due_date?: string | null } ``` ```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 \[DESTRUCTIVE] **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[]` ```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 | — | ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string }[] ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string }[] ``` ```ts theme={null} { id: number, iid?: number, title: string, state?: string, due_date?: string | null } ``` ```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 | — | ```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 | — | ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string }[] ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string }[] ``` ```ts theme={null} { id: number, iid?: number, title: string, state?: string, due_date?: string | null } ``` ```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[]` ```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[]` ```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 | — | ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string }[] ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string }[] ``` ```ts theme={null} { id: number, iid?: number, title: string, state?: string, due_date?: string | null } ``` ```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 | — | ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string }[] ``` ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string }[] ``` ```ts theme={null} { id: number, iid?: number, title: string, state?: string, due_date?: string | null } ``` ```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 \[DESTRUCTIVE] **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[]` ```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 | — | ```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 | — | ```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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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[]` ```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[]` ```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 | — | ```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 | — | ```ts theme={null} { id: number, name?: string, path?: string, kind?: string, full_path?: string, web_url?: string } ``` ```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 | — | ```ts theme={null} { id: number, name?: string, path?: string, kind?: string, full_path?: string, web_url?: string } ``` ```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 | — | ```ts theme={null} { id: number, name?: string, path?: string, kind?: string, full_path?: string, web_url?: string } ``` ```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[]` ```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 | — | ```ts theme={null} { id: number, name?: string, path?: string, kind?: string, full_path?: string, web_url?: string } ``` ```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 | — | ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```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 } ``` ```ts theme={null} { id: number, iid?: number, title: string, state?: string, due_date?: string | null }[] ``` *** ### delete `releases.delete` Delete a release \[DESTRUCTIVE] **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 | — | ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```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 } ``` ```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[]` ```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 | — | ```ts theme={null} { id: number, username: string, name?: string | null, state?: string, avatar_url?: string | null, web_url?: string } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 }[] ``` ```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[]` ```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[]` ```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. **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 Gitlab plugin for Corsair Use **Gitlab** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 62 typed API operations * 11 database entities synced for fast `.search()` / `.list()` queries * 5 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/gitlab ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { gitlab } from '@corsair-dev/gitlab'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [gitlab()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { gitlab } from '@corsair-dev/gitlab'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [gitlab()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/gitlab/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=gitlab ``` Use the key names documented in [Get Credentials](/plugins/gitlab/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=gitlab --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} gitlab() ``` Store credentials with `pnpm corsair setup --plugin=gitlab` (see [Get Credentials](/plugins/gitlab/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ```ts corsair.ts theme={null} gitlab({ authType: 'oauth_2', }) ``` Store credentials with `pnpm corsair setup --plugin=gitlab` (see [Get Credentials](/plugins/gitlab/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **5** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/gitlab/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.gitlab.db..search()` and `.list()`. See [Database](/plugins/gitlab/database) for filters and operators. ## Example API calls **Read-style (read):** `branches.get` ```ts theme={null} await corsair.gitlab.api.branches.get({}); ``` **Write-style (write):** `branches.create` ```ts theme={null} await corsair.gitlab.api.branches.create({}); ``` See the full list on the [API](/plugins/gitlab/api) page. Use `pnpm corsair list --plugin=gitlab` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/gitlab/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | -------------------------------------------------- | | API | [API](/plugins/gitlab/api) | | Database | [Database](/plugins/gitlab/database) | | Webhooks | [Webhooks](/plugins/gitlab/webhooks) | | Credentials | [Get credentials](/plugins/gitlab/get-credentials) | # 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). **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 | — | ```ts theme={null} { id?: number, name?: string, username?: string, avatar_url?: string } ``` ```ts theme={null} { id?: number, name?: string, web_url?: string, path_with_namespace?: string } ``` ```ts theme={null} { id?: number, iid?: number, title?: string, state?: string, action?: string, url?: string, description?: string | null, confidential?: boolean } ``` ```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 | — | ```ts theme={null} { id?: number, name?: string, username?: string, avatar_url?: string } ``` ```ts theme={null} { id?: number, name?: string, web_url?: string, path_with_namespace?: string } ``` ```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 } ``` ```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 | — | ```ts theme={null} { id?: number, name?: string, username?: string, avatar_url?: string } ``` ```ts theme={null} { id?: number, name?: string, web_url?: string, path_with_namespace?: string } ``` ```ts theme={null} { id?: number, note?: string, noteable_type?: string, noteable_id?: number, url?: string, action?: string } ``` ```ts theme={null} { id?: number, iid?: number, title?: string } ``` ```ts theme={null} { id?: number, iid?: number, title?: string } ``` ```ts theme={null} { id?: string, message?: string } ``` ```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 | — | ```ts theme={null} { id?: number, iid?: number, ref?: string, status?: string, source?: string, created_at?: string, finished_at?: string | null, duration?: number | null } ``` ```ts theme={null} { id?: number, name?: string, username?: string, avatar_url?: string } ``` ```ts theme={null} { id?: number, name?: string, web_url?: string, path_with_namespace?: string } ``` ```ts theme={null} { id?: number, stage?: string, name?: string, status?: string }[] ``` ```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 | — | ```ts theme={null} { id?: number, name?: string, web_url?: string, path_with_namespace?: string, default_branch?: string } ``` ```ts theme={null} { id: string, message?: string, title?: string, timestamp?: string, url?: string, author?: { name?: string, email?: string }, added?: string[], modified?: string[], removed?: string[] }[] ``` ```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/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. **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. | ```ts theme={null} { message?: { raw?: string, threadId?: string } } ``` **Output** | Name | Type | Required | Description | | --------- | -------- | -------- | ----------- | | `id` | `string` | No | — | | `message` | `object` | No | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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. | ```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. | ```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. | ```ts theme={null} { message?: { raw?: string, threadId?: string } } ``` **Output** | Name | Type | Required | Description | | --------- | -------- | -------- | ----------- | | `id` | `string` | No | — | | `message` | `object` | No | — | ```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 | — | ```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 | — | ```ts theme={null} { textColor?: string, backgroundColor?: string } ``` *** ### delete `labels.delete` Delete a label \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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` *** ### delete `messages.delete` Permanently delete a message \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.gmail.api.messages.delete({}); ``` **Input** | Name | Type | Required | Description | | -------- | -------- | -------- | ----------- | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | **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. | ```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 | — | ```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. | ```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. | ```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. | ```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. | ```ts theme={null} { partId?: string, mimeType?: string, filename?: string, headers?: { name?: string, value?: string }[], body?: { attachmentId?: string, size?: number, data?: string }, parts: lazy } ``` *** ## Threads ### delete `threads.delete` Permanently delete a thread \[DESTRUCTIVE · IRREVERSIBLE] **Risk:** `destructive` · **Irreversible** ```ts theme={null} await corsair.gmail.api.threads.delete({}); ``` **Input** | Name | Type | Required | Description | | -------- | -------- | -------- | ----------- | | `userId` | `string` | No | — | | `id` | `string` | Yes | — | **Output:** `void` *** ### 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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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.readonly` * `https://www.googleapis.com/auth/gmail.send` * `https://www.googleapis.com/auth/gmail.modify` * `https://www.googleapis.com/auth/gmail.compose` * 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 Gmail plugin for Corsair Use **Gmail** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 25 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries * 1 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/gmail ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { gmail } from '@corsair-dev/gmail'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [gmail()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { gmail } from '@corsair-dev/gmail'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [gmail()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/gmail/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=gmail ``` Use the key names documented in [Get Credentials](/plugins/gmail/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=gmail --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} gmail() ``` Store credentials with `pnpm corsair setup --plugin=gmail` (see [Get Credentials](/plugins/gmail/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **1** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/gmail/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.gmail.db..search()` and `.list()`. See [Database](/plugins/gmail/database) for filters and operators. ## Example API calls **Read-style (read):** `drafts.get` ```ts theme={null} await corsair.gmail.api.drafts.get({}); ``` **Write-style (write):** `drafts.create` ```ts theme={null} await corsair.gmail.api.drafts.create({}); ``` See the full list on the [API](/plugins/gmail/api) page. Use `pnpm corsair list --plugin=gmail` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/gmail/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------- | | API | [API](/plugins/gmail/api) | | Database | [Database](/plugins/gmail/database) | | Webhooks | [Webhooks](/plugins/gmail/webhooks) | | Credentials | [Get credentials](/plugins/gmail/get-credentials) | # 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). **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 | — | ```ts theme={null} { data?: string, attributes?: { }, messageId?: string, publishTime?: string } ``` ```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/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. **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 | — | ```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 | — | ```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` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { instanceId?: string, database?: string, type?: DATABASE_TYPE_UNSPECIFIED | POSTGRES | MYSQL, credential?: { username?: string, password?: string } } ``` ```ts theme={null} { serviceAccountId?: string } ``` ```ts theme={null} { crossAccountRole?: { iamRoleId?: string }, accessRole?: { iamRoleId?: string } } ``` ```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 | — | ```ts theme={null} { instanceId?: string, database?: string, type?: DATABASE_TYPE_UNSPECIFIED | POSTGRES | MYSQL, credential?: { username?: string, password?: string } } ``` ```ts theme={null} { serviceAccountId?: string } ``` ```ts theme={null} { crossAccountRole?: { iamRoleId?: string }, accessRole?: { iamRoleId?: string } } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { instanceId?: string, database?: string, type?: DATABASE_TYPE_UNSPECIFIED | POSTGRES | MYSQL, credential?: { username?: string, password?: string } } ``` ```ts theme={null} { serviceAccountId?: string } ``` ```ts theme={null} { crossAccountRole?: { iamRoleId?: string }, accessRole?: { iamRoleId?: string } } ``` ```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 | — | ```ts theme={null} { datasetId: string, projectId?: string } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { datasetId: string, projectId?: string } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { datasetId: string, projectId?: string } ``` ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { datasetId: string, projectId?: string } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { datasetId: string, projectId?: string } ``` ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { datasetId: string, projectId?: string } ``` ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { projectId?: string, datasetId: string, modelId: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { name?: string, type?: { } }[] ``` ```ts theme={null} { name?: string, 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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { projectId?: string, datasetId: string, modelId: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { name?: string, type?: { } }[] ``` ```ts theme={null} { name?: string, type?: { } }[] ``` ```ts theme={null} { }[] ``` *** ## Queries ### cancelJob `queries.cancelJob` Request cancellation of a running job \[DESTRUCTIVE] **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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```ts theme={null} { projectId?: string, jobId?: string, location?: string } ``` ```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?: { } } ``` ```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 }[] } ``` ```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 | — | ```ts theme={null} { fields?: { name: string, type: string, mode?: string, description?: string, fields?: lazy }[] } ``` ```ts theme={null} { projectId?: string, jobId?: string, location?: string } ``` ```ts theme={null} { f?: { v: any }[] }[] ``` ```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 | — | ```ts theme={null} { insertId?: string, json: { } }[] ``` **Output** | Name | Type | Required | Description | | -------------- | ---------- | -------- | ----------- | | `kind` | `string` | No | — | | `insertErrors` | `object[]` | No | — | ```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 | — | ```ts theme={null} { projectId?: string, jobId?: string, location?: string } ``` ```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 | — | ```ts theme={null} { projectId?: string, jobId?: string, location?: string } ``` ```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?: { } } ``` ```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 }[] } ``` ```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 | — | ```ts theme={null} { projectId?: string, jobId?: string, location?: string } ``` ```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 | — | ```ts theme={null} { projectId?: string, jobId?: string, location?: string } ``` ```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?: { } } ``` ```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 }[] } ``` ```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 | — | ```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 | — | ```ts theme={null} { datasetId: string, projectId?: string } ``` ```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 | — | ```ts theme={null} { fields?: { name: string, type: string, mode?: string, description?: string, fields?: lazy }[] } ``` ```ts theme={null} { projectId?: string, jobId?: string, location?: string } ``` ```ts theme={null} { f?: { v: any }[] }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { projectId?: string, datasetId: string, routineId: string } ``` ```ts theme={null} { name?: string, argumentKind?: FIXED_TYPE | ANY_TYPE, mode?: IN | OUT | INOUT, dataType?: { } }[] ``` ```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 | — | ```ts theme={null} { projectId?: string, datasetId: string, routineId: string } ``` ```ts theme={null} { name?: string, argumentKind?: FIXED_TYPE | ANY_TYPE, mode?: IN | OUT | INOUT, dataType?: { } }[] ``` ```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 | — | ```ts theme={null} { projectId?: string, datasetId: string, routineId: string } ``` ```ts theme={null} { name?: string, argumentKind?: FIXED_TYPE | ANY_TYPE, mode?: IN | OUT | INOUT, dataType?: { } }[] ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { projectId?: string, datasetId: string, routineId: string } ``` ```ts theme={null} { name?: string, argumentKind?: FIXED_TYPE | ANY_TYPE, mode?: IN | OUT | INOUT, dataType?: { } }[] ``` ```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 | — | ```ts theme={null} { projectId?: string, datasetId: string, tableId: string } ``` ```ts theme={null} { fields?: { name: string, type: string, mode?: string, description?: string, fields?: lazy }[] } ``` ```ts theme={null} { } ``` ```ts theme={null} { type?: DAY | HOUR | MONTH | YEAR, expirationMs?: string, field?: string } ``` ```ts theme={null} { fields?: string[] } ``` ```ts theme={null} { query?: string, useLegacySql?: boolean } ``` ```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 | — | ```ts theme={null} { projectId?: string, datasetId: string, tableId: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { fields?: { name: string, type: string, mode?: string, description?: string, fields?: lazy }[] } ``` ```ts theme={null} { type?: DAY | HOUR | MONTH | YEAR, expirationMs?: string, field?: string } ``` ```ts theme={null} { fields?: string[] } ``` ```ts theme={null} { query?: string, useLegacySql?: boolean } ``` ```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 | — | ```ts theme={null} { projectId?: string, datasetId: string, tableId: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { fields?: { name: string, type: string, mode?: string, description?: string, fields?: lazy }[] } ``` ```ts theme={null} { type?: DAY | HOUR | MONTH | YEAR, expirationMs?: string, field?: string } ``` ```ts theme={null} { fields?: string[] } ``` ```ts theme={null} { query?: string, useLegacySql?: boolean } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { projectId?: string, datasetId: string, tableId: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { fields?: { name: string, type: string, mode?: string, description?: string, fields?: lazy }[] } ``` ```ts theme={null} { type?: DAY | HOUR | MONTH | YEAR, expirationMs?: string, field?: string } ``` ```ts theme={null} { fields?: string[] } ``` ```ts theme={null} { query?: string, useLegacySql?: boolean } ``` ```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 | — | ```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 | — | ```ts theme={null} { projectId?: string, datasetId: string, tableId: string } ``` ```ts theme={null} { } ``` ```ts theme={null} { fields?: { name: string, type: string, mode?: string, description?: string, fields?: lazy }[] } ``` ```ts theme={null} { type?: DAY | HOUR | MONTH | YEAR, expirationMs?: string, field?: string } ``` ```ts theme={null} { fields?: string[] } ``` ```ts theme={null} { query?: string, useLegacySql?: boolean } ``` ```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. **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 Google BigQuery plugin for Corsair Use **Google BigQuery** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 62 typed API operations * 5 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/googlebigquery ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googlebigquery } from '@corsair-dev/googlebigquery'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [googlebigquery()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googlebigquery } from '@corsair-dev/googlebigquery'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [googlebigquery()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/googlebigquery/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=googlebigquery ``` Use the key names documented in [Get Credentials](/plugins/googlebigquery/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=googlebigquery --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} googlebigquery() ``` Store credentials with `pnpm corsair setup --plugin=googlebigquery` (see [Get Credentials](/plugins/googlebigquery/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Query synced data Synced entities support `corsair.googlebigquery.db..search()` and `.list()`. See [Database](/plugins/googlebigquery/database) for filters and operators. ## Example API calls **Read-style (read):** `analyticsHub.listDataexchangesListings` ```ts theme={null} await corsair.googlebigquery.api.analyticsHub.listDataexchangesListings({}); ``` **Write-style (write):** `analyticsHub.createDataExchange` ```ts theme={null} await corsair.googlebigquery.api.analyticsHub.createDataExchange({}); ``` See the full list on the [API](/plugins/googlebigquery/api) page. Use `pnpm corsair list --plugin=googlebigquery` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ---------------------------------------------------------- | | API | [API](/plugins/googlebigquery/api) | | Database | [Database](/plugins/googlebigquery/database) | | Credentials | [Get credentials](/plugins/googlebigquery/get-credentials) | # 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. **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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { id?: string, email?: string, displayName?: string, self?: boolean } ``` ```ts theme={null} { id?: string, email?: string, displayName?: string, self?: boolean } ``` ```ts theme={null} { date?: string, dateTime?: string, timeZone?: string } ``` ```ts theme={null} { date?: string, dateTime?: string, timeZone?: string } ``` ```ts theme={null} { date?: string, dateTime?: string, timeZone?: string } ``` ```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 }[] ``` ```ts theme={null} { useDefault?: boolean, overrides?: { method?: email | popup, minutes?: number }[] } ``` ```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 } ``` ```ts theme={null} { fileUrl?: string, title?: string, mimeType?: string, iconLink?: string, fileId?: string }[] ``` ```ts theme={null} { url?: string, title?: string } ``` ```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 \[DESTRUCTIVE] **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 | — | ```ts theme={null} { id?: string, email?: string, displayName?: string, self?: boolean } ``` ```ts theme={null} { id?: string, email?: string, displayName?: string, self?: boolean } ``` ```ts theme={null} { date?: string, dateTime?: string, timeZone?: string } ``` ```ts theme={null} { date?: string, dateTime?: string, timeZone?: string } ``` ```ts theme={null} { date?: string, dateTime?: string, timeZone?: string } ``` ```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 }[] ``` ```ts theme={null} { useDefault?: boolean, overrides?: { method?: email | popup, minutes?: number }[] } ``` ```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 } ``` ```ts theme={null} { fileUrl?: string, title?: string, mimeType?: string, iconLink?: string, fileId?: string }[] ``` ```ts theme={null} { url?: string, title?: string } ``` ```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 | — | ```ts theme={null} { method?: email | popup, minutes?: number }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { id?: string, email?: string, displayName?: string, self?: boolean } ``` ```ts theme={null} { id?: string, email?: string, displayName?: string, self?: boolean } ``` ```ts theme={null} { date?: string, dateTime?: string, timeZone?: string } ``` ```ts theme={null} { date?: string, dateTime?: string, timeZone?: string } ``` ```ts theme={null} { date?: string, dateTime?: string, timeZone?: string } ``` ```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 }[] ``` ```ts theme={null} { useDefault?: boolean, overrides?: { method?: email | popup, minutes?: number }[] } ``` ```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 } ``` ```ts theme={null} { fileUrl?: string, title?: string, mimeType?: string, iconLink?: string, fileId?: string }[] ``` ```ts theme={null} { url?: string, title?: string } ``` ```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. **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` * 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 Google calendar plugin for Corsair Use **Google calendar** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 6 typed API operations * 2 database entities synced for fast `.search()` / `.list()` queries * 1 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/googlecalendar ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googlecalendar } from '@corsair-dev/googlecalendar'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [googlecalendar()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googlecalendar } from '@corsair-dev/googlecalendar'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [googlecalendar()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/googlecalendar/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=googlecalendar ``` Use the key names documented in [Get Credentials](/plugins/googlecalendar/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=googlecalendar --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} googlecalendar() ``` Store credentials with `pnpm corsair setup --plugin=googlecalendar` (see [Get Credentials](/plugins/googlecalendar/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **1** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/googlecalendar/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.googlecalendar.db..search()` and `.list()`. See [Database](/plugins/googlecalendar/database) for filters and operators. ## Example API calls **Read-style (read):** `calendar.getAvailability` ```ts theme={null} await corsair.googlecalendar.api.calendar.getAvailability({}); ``` **Write-style (write):** `events.create` ```ts theme={null} await corsair.googlecalendar.api.events.create({}); ``` See the full list on the [API](/plugins/googlecalendar/api) page. Use `pnpm corsair list --plugin=googlecalendar` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/googlecalendar/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ---------------------------------------------------------- | | API | [API](/plugins/googlecalendar/api) | | Database | [Database](/plugins/googlecalendar/database) | | Webhooks | [Webhooks](/plugins/googlecalendar/webhooks) | | Credentials | [Get credentials](/plugins/googlecalendar/get-credentials) | # 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). **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 | — | ```ts theme={null} { data?: string, attributes?: { }, messageId?: string, publishTime?: string } ``` ```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/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. **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 | — | *** ### 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 | — | *** ### 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 | — | *** ### 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 **Risk:** `read` ```ts theme={null} await corsair.googledocs.api.documents.getDocument({}); ``` **Input** | Name | Type | Required | Description | | ------------ | -------- | -------- | ----------- | | `documentId` | `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 | — | *** ### getDocumentPlaintext `documents.getDocumentPlaintext` Retrieve a Google Doc as best-effort plain text **Risk:** `read` ```ts theme={null} await corsair.googledocs.api.documents.getDocumentPlaintext({}); ``` **Input** | Name | Type | Required | Description | | ------------ | -------- | -------- | ----------- | | `documentId` | `string` | Yes | — | **Output** | Name | Type | Required | Description | | ------------ | -------- | -------- | ----------- | | `documentId` | `string` | Yes | — | | `title` | `string` | No | — | | `text` | `string` | Yes | — | | `wordCount` | `number` | Yes | — | *** ### 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 | — | ```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 | — | ```ts theme={null} { }[] ``` ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | -------------- | ---------- | -------- | ----------- | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | -------------- | ---------- | -------- | ----------- | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | -------------- | ---------- | -------- | ----------- | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | ```ts theme={null} { }[] ``` ```ts theme={null} { requiredRevisionId?: string, targetRevisionId?: string } ``` *** ## 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 | — | ```ts theme={null} { index: number, segmentId?: string, tabId?: string } ``` **Output** | Name | Type | Required | Description | | -------------- | ---------- | -------- | ----------- | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { index: number, segmentId?: string, tabId?: string } ``` ```ts theme={null} { segmentId?: string, tabId?: string } ``` **Output** | Name | Type | Required | Description | | -------------- | ---------- | -------- | ----------- | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { index: number, segmentId?: string, tabId?: string } ``` **Output** | Name | Type | Required | Description | | -------------- | ---------- | -------- | ----------- | | `documentId` | `string` | No | — | | `replies` | `object[]` | No | — | | `writeControl` | `object` | No | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { index: number, segmentId?: string, tabId?: string } ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { }[] ``` ```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. **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 Google Docs plugin for Corsair Use **Google Docs** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. 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:** * 35 typed API operations * 1 database entity synced for fast `.search()` / `.list()` queries * 1 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/googledocs ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googledocs } from '@corsair-dev/googledocs'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [googledocs()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googledocs } from '@corsair-dev/googledocs'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [googledocs()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/googledocs/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=googledocs ``` Use the key names documented in [Get Credentials](/plugins/googledocs/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=googledocs --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} googledocs() ``` Store credentials with `pnpm corsair setup --plugin=googledocs` (see [Get Credentials](/plugins/googledocs/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **1** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/googledocs/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.googledocs.db..search()` and `.list()`. See [Database](/plugins/googledocs/database) for filters and operators. ## Example API calls **Read-style (read):** `documents.exportDocumentAsPdf` ```ts theme={null} await corsair.googledocs.api.documents.exportDocumentAsPdf({}); ``` **Write-style (write):** `documents.copyDocument` ```ts theme={null} await corsair.googledocs.api.documents.copyDocument({}); ``` See the full list on the [API](/plugins/googledocs/api) page. Use `pnpm corsair list --plugin=googledocs` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/googledocs/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------------ | | API | [API](/plugins/googledocs/api) | | Database | [Database](/plugins/googledocs/database) | | Webhooks | [Webhooks](/plugins/googledocs/webhooks) | | Credentials | [Get credentials](/plugins/googledocs/get-credentials) | # 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). **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 | — | ```ts theme={null} { data?: string, attributes?: { }, messageId?: string, publishTime?: string } ``` ```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. **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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | *** # 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. **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 Google drive plugin for Corsair Use **Google drive** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 21 typed API operations * 3 database entities synced for fast `.search()` / `.list()` queries * 1 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/googledrive ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googledrive } from '@corsair-dev/googledrive'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [googledrive()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googledrive } from '@corsair-dev/googledrive'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [googledrive()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/googledrive/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=googledrive ``` Use the key names documented in [Get Credentials](/plugins/googledrive/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=googledrive --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} googledrive() ``` Store credentials with `pnpm corsair setup --plugin=googledrive` (see [Get Credentials](/plugins/googledrive/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **1** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/googledrive/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.googledrive.db..search()` and `.list()`. See [Database](/plugins/googledrive/database) for filters and operators. ## Example API calls **Read-style (read):** `files.download` ```ts theme={null} await corsair.googledrive.api.files.download({}); ``` **Write-style (write):** `files.copy` ```ts theme={null} await corsair.googledrive.api.files.copy({}); ``` See the full list on the [API](/plugins/googledrive/api) page. Use `pnpm corsair list --plugin=googledrive` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/googledrive/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------------- | | API | [API](/plugins/googledrive/api) | | Database | [Database](/plugins/googledrive/database) | | Webhooks | [Webhooks](/plugins/googledrive/webhooks) | | Credentials | [Get credentials](/plugins/googledrive/get-credentials) | # 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). **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 | — | ```ts theme={null} { data?: string, attributes?: { }, messageId?: string, publishTime?: string } ``` ```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 GoogleMaps: 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. **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. | ```ts theme={null} { }[] ``` ```ts theme={null} { }[] ``` **Output** | Name | Type | Required | Description | | ---------- | -------- | -------- | ----------- | | `location` | `object` | Yes | — | | `accuracy` | `number` | Yes | — | ```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. | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------- | ---------- | -------- | ----------- | | `suggestions` | `object[]` | No | — | ```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 | — | ```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. | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | -------- | ---------- | -------- | ----------- | | `places` | `object[]` | No | — | ```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. | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | -------- | ---------- | -------- | ----------- | | `places` | `object[]` | No | — | ```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. | ```ts theme={null} { }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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. | ```ts theme={null} { } ``` ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | -------- | ---------- | -------- | ----------- | | `routes` | `object[]` | No | — | ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` *** # Database Source: https://docs.corsair.dev/plugins/googlemaps/database GoogleMaps local sync: searchable entities, `.search()` filters, and operators. The GoogleMaps plugin syncs data locally. Use `corsair.googlemaps.db..search({ data, limit?, offset? })` with the filters listed per entity. **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 GoogleMaps plugin for Corsair Use **GoogleMaps** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 22 typed API operations ## Setup ```bash theme={null} pnpm install @corsair-dev/googlemaps ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googlemaps } from '@corsair-dev/googlemaps'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [googlemaps()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googlemaps } from '@corsair-dev/googlemaps'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [googlemaps()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/googlemaps/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=googlemaps ``` Use the key names documented in [Get Credentials](/plugins/googlemaps/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=googlemaps --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} googlemaps() ``` Store credentials with `pnpm corsair setup --plugin=googlemaps` (see [Get Credentials](/plugins/googlemaps/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ```ts corsair.ts theme={null} googlemaps({ authType: 'oauth_2', }) ``` Store credentials with `pnpm corsair setup --plugin=googlemaps` (see [Get Credentials](/plugins/googlemaps/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Example API calls **Read-style (read):** `aerial.lookupAerialVideo` ```ts theme={null} await corsair.googlemaps.api.aerial.lookupAerialVideo({}); ``` **Write-style (write):** `aerial.renderAerialVideo` ```ts theme={null} await corsair.googlemaps.api.aerial.renderAerialVideo({}); ``` See the full list on the [API](/plugins/googlemaps/api) page. Use `pnpm corsair list --plugin=googlemaps` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------------ | | API | [API](/plugins/googlemaps/api) | | Credentials | [Get credentials](/plugins/googlemaps/get-credentials) | # 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. **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 | — | ```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 | — | ```ts theme={null} { user?: string, displayName?: string } ``` ```ts theme={null} { displayName?: string } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 } } } ``` ```ts theme={null} { conferenceRecord?: string } ``` ```ts theme={null} { languageCode?: string, phoneNumber?: string, pin?: string, regionCode?: string }[] ``` ```ts theme={null} { uri?: string, sipAccessCode?: string }[] ``` *** ### endActiveConference `spaces.endActiveConference` End an active conference \[DESTRUCTIVE] **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 | — | ```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 } } } ``` ```ts theme={null} { conferenceRecord?: string } ``` ```ts theme={null} { languageCode?: string, phoneNumber?: string, pin?: string, regionCode?: string }[] ``` ```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 | — | ```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 | — | ```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 } } } ``` ```ts theme={null} { conferenceRecord?: string } ``` ```ts theme={null} { languageCode?: string, phoneNumber?: string, pin?: string, regionCode?: string }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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. **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 Google Meet plugin for Corsair Use **Google Meet** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 18 typed API operations * 6 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/googlemeet ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googlemeet } from '@corsair-dev/googlemeet'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [googlemeet()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googlemeet } from '@corsair-dev/googlemeet'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [googlemeet()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/googlemeet/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=googlemeet ``` Use the key names documented in [Get Credentials](/plugins/googlemeet/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=googlemeet --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} googlemeet() ``` Store credentials with `pnpm corsair setup --plugin=googlemeet` (see [Get Credentials](/plugins/googlemeet/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Query synced data Synced entities support `corsair.googlemeet.db..search()` and `.list()`. See [Database](/plugins/googlemeet/database) for filters and operators. ## Example API calls **Read-style (read):** `conferenceRecords.get` ```ts theme={null} await corsair.googlemeet.api.conferenceRecords.get({}); ``` **Write-style (write):** `spaces.create` ```ts theme={null} await corsair.googlemeet.api.spaces.create({}); ``` See the full list on the [API](/plugins/googlemeet/api) page. Use `pnpm corsair list --plugin=googlemeet` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------------ | | API | [API](/plugins/googlemeet/api) | | Database | [Database](/plugins/googlemeet/database) | | Credentials | [Get credentials](/plugins/googlemeet/get-credentials) | # 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. **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 | — | ```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 | — | ```ts theme={null} { range?: string, majorDimension?: ROWS | COLUMNS | DIMENSION_UNSPECIFIED, values?: ( string | number | boolean | null )[][] }[] ``` *** ### clearSheet `sheets.clearSheet` Clear all data from a sheet \[DESTRUCTIVE] **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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { title?: string, locale?: string, timeZone?: string } ``` **Output** | Name | Type | Required | Description | | ---------------- | -------- | -------- | ----------- | | `spreadsheetId` | `string` | No | — | | `properties` | `object` | No | — | | `spreadsheetUrl` | `string` | No | — | ```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 | — | ```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. **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` * 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 Google sheets plugin for Corsair Use **Google sheets** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 12 typed API operations * 3 database entities synced for fast `.search()` / `.list()` queries * 1 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/googlesheets ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googlesheets } from '@corsair-dev/googlesheets'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [googlesheets()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { googlesheets } from '@corsair-dev/googlesheets'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [googlesheets()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/googlesheets/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=googlesheets ``` Use the key names documented in [Get Credentials](/plugins/googlesheets/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=googlesheets --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} googlesheets() ``` Store credentials with `pnpm corsair setup --plugin=googlesheets` (see [Get Credentials](/plugins/googlesheets/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **1** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/googlesheets/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.googlesheets.db..search()` and `.list()`. See [Database](/plugins/googlesheets/database) for filters and operators. ## Example API calls **Read-style (read):** `sheets.getRows` ```ts theme={null} await corsair.googlesheets.api.sheets.getRows({}); ``` **Write-style (write):** `sheets.appendOrUpdateRow` ```ts theme={null} await corsair.googlesheets.api.sheets.appendOrUpdateRow({}); ``` See the full list on the [API](/plugins/googlesheets/api) page. Use `pnpm corsair list --plugin=googlesheets` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/googlesheets/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | -------------------------------------------------------- | | API | [API](/plugins/googlesheets/api) | | Database | [Database](/plugins/googlesheets/database) | | Webhooks | [Webhooks](/plugins/googlesheets/webhooks) | | Credentials | [Get credentials](/plugins/googlesheets/get-credentials) | # 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). **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 | — | ```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. **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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 Grafana plugin for Corsair Use **Grafana** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 11 typed API operations * 6 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/grafana ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { grafana } from '@corsair-dev/grafana'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [grafana()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { grafana } from '@corsair-dev/grafana'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [grafana()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/grafana/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=grafana ``` Use the key names documented in [Get Credentials](/plugins/grafana/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=grafana --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} grafana() ``` Store credentials with `pnpm corsair setup --plugin=grafana` (see [Get Credentials](/plugins/grafana/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.grafana.db..search()` and `.list()`. See [Database](/plugins/grafana/database) for filters and operators. ## Example API calls **Read-style (read):** `dashboards.queryPublic` ```ts theme={null} await corsair.grafana.api.dashboards.queryPublic({}); ``` **Write-style (write):** `logs.createOtlp` ```ts theme={null} await corsair.grafana.api.logs.createOtlp({}); ``` See the full list on the [API](/plugins/grafana/api) page. Use `pnpm corsair list --plugin=grafana` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | --------------------------------------------------- | | API | [API](/plugins/grafana/api) | | Database | [Database](/plugins/grafana/database) | | Credentials | [Get credentials](/plugins/grafana/get-credentials) | # 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. **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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 Hacker news plugin for Corsair Use **Hacker news** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 16 typed API operations * 2 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/hackernews ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { hackernews } from '@corsair-dev/hackernews'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [hackernews()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { hackernews } from '@corsair-dev/hackernews'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [hackernews()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/hackernews/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=hackernews ``` Use the key names documented in [Get Credentials](/plugins/hackernews/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=hackernews --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} hackernews() ``` Store credentials with `pnpm corsair setup --plugin=hackernews` (see [Get Credentials](/plugins/hackernews/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.hackernews.db..search()` and `.list()`. See [Database](/plugins/hackernews/database) for filters and operators. ## Example API calls **Read-style (read):** `items.get` ```ts theme={null} await corsair.hackernews.api.items.get({}); ``` **Write-style (read):** `updates.get` ```ts theme={null} await corsair.hackernews.api.updates.get({}); ``` See the full list on the [API](/plugins/hackernews/api) page. Use `pnpm corsair list --plugin=hackernews` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------------ | | API | [API](/plugins/hackernews/api) | | Database | [Database](/plugins/hackernews/database) | | Credentials | [Get credentials](/plugins/hackernews/get-credentials) | # 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. **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 | — | ```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 | — | ```ts theme={null} { slug: string, name?: string }[] ``` ```ts theme={null} { enableTableOfContent?: boolean, delist?: boolean, activateNewsletter?: boolean, slugOverridden?: boolean } ``` ```ts theme={null} { title?: string, description?: string, image?: string } ``` ```ts theme={null} { coverImageURL?: string, coverImageAttribution?: string, coverImagePhotographer?: string, isCoverAttributionHidden?: boolean, stickCoverToBottom?: boolean } ``` **Output** | Name | Type | Required | Description | | ------------- | -------- | -------- | ----------- | | `createDraft` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { slug: string, name?: string }[] ``` ```ts theme={null} { enableTableOfContent?: boolean, delist?: boolean, activateNewsletter?: boolean, slugOverridden?: boolean } ``` ```ts theme={null} { title?: string, description?: string, image?: string } ``` ```ts theme={null} { coverImageURL?: string, coverImageAttribution?: string, coverImagePhotographer?: string, isCoverAttributionHidden?: boolean, stickCoverToBottom?: boolean } ``` **Output** | Name | Type | Required | Description | | ------------- | -------- | -------- | ----------- | | `updateDraft` | `object` | Yes | — | ```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 | — | ```ts theme={null} { tags?: string[], excludeTags?: string[], publications?: string[], excludePublications?: string[] } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `feed` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { tagSlugs?: string[] } ``` **Output** | Name | Type | Required | Description | | ------------- | -------- | -------- | ----------- | | `publication` | `object` | Yes | — | ```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 | — | ```ts theme={null} { slug: string, name?: string }[] ``` **Output** | Name | Type | Required | Description | | ------------- | -------- | -------- | ----------- | | `publishPost` | `object` | Yes | — | ```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 | — | ```ts theme={null} { query?: string, publicationId: string, deletedOnly?: boolean, authorIds?: string[], tagIds?: string[] } ``` **Output** | Name | Type | Required | Description | | -------------------------- | -------- | -------- | ----------- | | `searchPostsOfPublication` | `object` | Yes | — | ```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 | — | ```ts theme={null} { slug: string, name?: string }[] ``` **Output** | Name | Type | Required | Description | | ------------ | -------- | -------- | ----------- | | `updatePost` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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 Hashnode plugin for Corsair Use **Hashnode** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 23 typed API operations ## Setup ```bash theme={null} pnpm install @corsair-dev/hashnode ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { hashnode } from '@corsair-dev/hashnode'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [hashnode()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { hashnode } from '@corsair-dev/hashnode'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [hashnode()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/hashnode/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=hashnode ``` Use the key names documented in [Get Credentials](/plugins/hashnode/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=hashnode --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} hashnode() ``` Store credentials with `pnpm corsair setup --plugin=hashnode` (see [Get Credentials](/plugins/hashnode/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Example API calls **Read-style (read):** `comments.list` ```ts theme={null} await corsair.hashnode.api.comments.list({}); ``` **Write-style (write):** `drafts.create` ```ts theme={null} await corsair.hashnode.api.drafts.create({}); ``` See the full list on the [API](/plugins/hashnode/api) page. Use `pnpm corsair list --plugin=hashnode` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ---------------------------------------------------- | | API | [API](/plugins/hashnode/api) | | Credentials | [Get credentials](/plugins/hashnode/get-credentials) | # 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. **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 | — | ```ts theme={null} { type: url, url: string } | { type: asset_id, asset_id: string } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { type: url, url: string } | { type: asset_id, asset_id: string } | { type: base64, media_type: string, data: string } ``` ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { type: url, url: string } | { type: asset_id, asset_id: string } ``` ```ts theme={null} { type: url, url: string } | { type: asset_id, asset_id: string } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { type: url, url: string } | { type: asset_id, asset_id: string } ``` ```ts theme={null} { type: url, url: string } | { type: asset_id, asset_id: string } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { type: url, url: string } | { type: asset_id, asset_id: string } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | Yes | — | ```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 | — | ```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 | — | ```ts theme={null} { candidate: string, sdpMLineIndex?: string | number, sdpMid?: string, usernameFragment?: string } ``` **Output** | Name | Type | Required | Description | | ------- | -------- | -------- | ----------- | | `error` | `any` | No | — | | `data` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------- | -------- | -------- | ----------- | | `error` | `any` | No | — | | `data` | `object` | Yes | — | ```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 | — | ```ts theme={null} { type: string, sdp: string } ``` **Output** | Name | Type | Required | Description | | ------- | -------- | -------- | ----------- | | `error` | `any` | No | — | | `data` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { email?: string, first_name?: string }[] ``` **Output** | Name | Type | Required | Description | | ------- | -------- | -------- | ----------- | | `error` | `any` | No | — | | `data` | `object` | Yes | — | ```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 | — | ```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 | — | ```ts theme={null} { width: number, height: number } ``` ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------- | -------- | -------- | ----------- | | `error` | `any` | No | — | | `data` | `object` | Yes | — | ```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 | — | ```ts theme={null} { type: url, url: string } | { type: asset_id, asset_id: string } ``` ```ts theme={null} { type: url, url: string } | { type: asset_id, asset_id: string } ``` **Output** | Name | Type | Required | Description | | ------ | -------- | -------- | ----------- | | `data` | `object` | Yes | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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 HeyGen plugin for Corsair Use **HeyGen** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 135 typed API operations ## Setup ```bash theme={null} pnpm install @corsair-dev/heygen ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { heygen } from '@corsair-dev/heygen'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [heygen()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { heygen } from '@corsair-dev/heygen'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [heygen()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/heygen/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=heygen ``` Use the key names documented in [Get Credentials](/plugins/heygen/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=heygen --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} heygen() ``` Store credentials with `pnpm corsair setup --plugin=heygen` (see [Get Credentials](/plugins/heygen/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Example API calls **Read-style (read):** `aiClipping.get` ```ts theme={null} await corsair.heygen.api.aiClipping.get({}); ``` **Write-style (write):** `aiClipping.create` ```ts theme={null} await corsair.heygen.api.aiClipping.create({}); ``` See the full list on the [API](/plugins/heygen/api) page. Use `pnpm corsair list --plugin=heygen` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | -------------------------------------------------- | | API | [API](/plugins/heygen/api) | | Credentials | [Get credentials](/plugins/heygen/get-credentials) | # 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. **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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { id: string, properties?: { }, createdAt?: Date | null, updatedAt?: Date | null, archived?: boolean, associations?: { } }[] ``` ```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 | — | ```ts theme={null} { id: string, properties?: { }, createdAt?: Date | null, updatedAt?: Date | null, archived?: boolean, associations?: { } }[] ``` ```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 | — | ```ts theme={null} { id: string, properties?: { }, createdAt?: Date | null, updatedAt?: Date | null, archived?: boolean, associations?: { } }[] ``` ```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 | — | ```ts theme={null} { id: string, properties?: { }, createdAt?: Date | null, updatedAt?: Date | null, archived?: boolean, associations?: { } }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { id: string, properties?: { }, createdAt?: Date | null, updatedAt?: Date | null, archived?: boolean, associations?: { } }[] ``` ```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 | — | ```ts theme={null} { id: string, properties?: { }, createdAt?: Date | null, updatedAt?: Date | null, archived?: boolean, associations?: { } }[] ``` ```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 | — | ```ts theme={null} { id: string, properties?: { }, createdAt?: Date | null, updatedAt?: Date | null, archived?: boolean, associations?: { } }[] ``` ```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 | — | ```ts theme={null} { propertyName: string, direction: ASCENDING | DESCENDING }[] ``` ```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 | — | ```ts theme={null} { id: string, properties?: { }, createdAt?: Date | null, updatedAt?: Date | null, archived?: boolean, associations?: { } }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { id: string, properties?: { }, createdAt?: Date | null, updatedAt?: Date | null, archived?: boolean, associations?: { } }[] ``` ```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 | — | ```ts theme={null} { id: string, properties?: { }, createdAt?: Date | null, updatedAt?: Date | null, archived?: boolean, associations?: { } }[] ``` ```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 | — | ```ts theme={null} { id: string, properties?: { }, createdAt?: Date | null, updatedAt?: Date | null, archived?: boolean, associations?: { } }[] ``` ```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 | — | ```ts theme={null} { propertyName: string, direction: ASCENDING | DESCENDING }[] ``` ```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 | — | ```ts theme={null} { id: string, properties?: { }, createdAt?: Date | null, updatedAt?: Date | null, archived?: boolean, associations?: { } }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { active?: boolean, type: string, timestamp?: number } ``` ```ts theme={null} { contactIds?: number[], companyIds?: number[], dealIds?: number[], ownerIds?: number[] } ``` ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | -------------- | -------- | -------- | ----------- | | `id` | `string` | Yes | — | | `engagement` | `object` | No | — | | `associations` | `object` | No | — | | `metadata` | `object` | No | — | ```ts theme={null} { id?: number, portalId?: number, active?: boolean, createdAt?: number, lastUpdated?: number, createdBy?: number, modifiedBy?: number, ownerId?: number, type?: string, timestamp?: number } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { id?: number, portalId?: number, active?: boolean, createdAt?: number, lastUpdated?: number, createdBy?: number, modifiedBy?: number, ownerId?: number, type?: string, timestamp?: number } ``` ```ts theme={null} { } ``` ```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 | — | ```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?: { } }[] ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { id: string, properties?: { }, createdAt?: Date | null, updatedAt?: Date | null, archived?: boolean, associations?: { } }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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. **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 Hubspot plugin for Corsair Use **Hubspot** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 35 typed API operations * 5 database entities synced for fast `.search()` / `.list()` queries * 12 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/hubspot ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { hubspot } from '@corsair-dev/hubspot'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [hubspot()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { hubspot } from '@corsair-dev/hubspot'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [hubspot()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/hubspot/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=hubspot ``` Use the key names documented in [Get Credentials](/plugins/hubspot/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=hubspot --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} hubspot() ``` Store credentials with `pnpm corsair setup --plugin=hubspot` (see [Get Credentials](/plugins/hubspot/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ```ts corsair.ts theme={null} hubspot({ authType: 'oauth_2', }) ``` Store credentials with `pnpm corsair setup --plugin=hubspot` (see [Get Credentials](/plugins/hubspot/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **12** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/hubspot/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.hubspot.db..search()` and `.list()`. See [Database](/plugins/hubspot/database) for filters and operators. ## Example API calls **Read-style (read):** `companies.get` ```ts theme={null} await corsair.hubspot.api.companies.get({}); ``` **Write-style (write):** `companies.create` ```ts theme={null} await corsair.hubspot.api.companies.create({}); ``` See the full list on the [API](/plugins/hubspot/api) page. Use `pnpm corsair list --plugin=hubspot` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/hubspot/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | --------------------------------------------------- | | API | [API](/plugins/hubspot/api) | | Database | [Database](/plugins/hubspot/database) | | Webhooks | [Webhooks](/plugins/hubspot/webhooks) | | Credentials | [Get credentials](/plugins/hubspot/get-credentials) | # 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). **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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/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. **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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` **Output:** `object` ```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` ```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` ```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` ```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` ```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` ```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` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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 | — | ```ts theme={null} { }[] ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` **Output:** `object` ```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` ```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` ```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` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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` ```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` ```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` ```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` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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` ```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` ```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` ```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` ```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` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```ts theme={null} { } ``` **Output:** `object` ```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 | — | ```ts theme={null} { } ``` **Output:** `object` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```ts theme={null} { }[] ``` **Output:** `object` ```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` ```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` ```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` ```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` ```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` ```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. **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 Insighto.ai plugin for Corsair Use **Insighto.ai** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 66 typed API operations ## Setup ```bash theme={null} pnpm install @corsair-dev/insightoai ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { insightoai } from '@corsair-dev/insightoai'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [insightoai()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { insightoai } from '@corsair-dev/insightoai'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [insightoai()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/insightoai/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=insightoai ``` Use the key names documented in [Get Credentials](/plugins/insightoai/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=insightoai --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} insightoai() ``` Store credentials with `pnpm corsair setup --plugin=insightoai` (see [Get Credentials](/plugins/insightoai/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ```ts corsair.ts theme={null} insightoai({ authType: 'oauth_2', }) ``` Store credentials with `pnpm corsair setup --plugin=insightoai` (see [Get Credentials](/plugins/insightoai/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Example API calls **Read-style (read):** `agency.getAgencyBillingPlan` ```ts theme={null} await corsair.insightoai.api.agency.getAgencyBillingPlan({}); ``` **Write-style (write):** `agency.createAgency` ```ts theme={null} await corsair.insightoai.api.agency.createAgency({}); ``` See the full list on the [API](/plugins/insightoai/api) page. Use `pnpm corsair list --plugin=insightoai` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------------ | | API | [API](/plugins/insightoai/api) | | Credentials | [Get credentials](/plugins/insightoai/get-credentials) | # 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. **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. | ```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. | ```ts theme={null} { id: string, username: string } ``` ```ts theme={null} { id: string, media_product_type?: string } ``` ```ts theme={null} { id: string, text?: string, timestamp?: 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. | **Output** | Name | Type | Required | Description | | ------ | ---------- | -------- | ------------------------------------------------------------------- | | `data` | `object[]` | No | The list of comments associated with the requested Instagram media. | ```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. | **Output** | Name | Type | Required | Description | | ------ | ---------- | -------- | ----------------------------------------------------------------- | | `data` | `object[]` | Yes | The list of messages contained within the specified conversation. | ```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 }[] } }[] ``` *** ### 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. | **Output** | Name | Type | Required | Description | | ------ | ---------- | -------- | -------------------------------------------------------------------------- | | `data` | `object[]` | Yes | The list of Instagram conversations associated with the connected account. | ```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. | ```ts theme={null} { username: string, x: number, y: number }[] ``` ```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 ### 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` | Yes | 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` | Yes | The permanent public URL to view the media on Instagram. | | `timestamp` | `string` | Yes | The ISO 8601 timestamp indicating when the media was created. | | `username` | `string` | Yes | 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` | Yes | 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. | ```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. | ```ts theme={null} { }[] ``` *** ### 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. | **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. | ```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 }[] ``` ```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` | Yes | The current processing status of the media container. IN\_PROGRESS indicates processing is ongoing, FINISHED indicates the media is ready to publish, 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. | ```ts theme={null} { id?: string, username?: string } ``` ```ts theme={null} { data?: { id?: string, mime_type?: string, name?: string, image_data?: { }, video_data?: { }, file_url?: string }[] } ``` *** ### 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. | ```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. | *** ## Profile ### 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. | ```ts theme={null} { }[] ``` *** ## 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. | ```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. | ```ts theme={null} { username: string, x: number, y: number }[] ``` ```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. **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 Instagram plugin for Corsair Use **Instagram** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 23 typed API operations * 5 database entities synced for fast `.search()` / `.list()` queries * 3 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/instagram ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { instagram } from '@corsair-dev/instagram'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [instagram()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { instagram } from '@corsair-dev/instagram'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [instagram()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/instagram/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=instagram ``` Use the key names documented in [Get Credentials](/plugins/instagram/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=instagram --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} instagram() ``` Store credentials with `pnpm corsair setup --plugin=instagram` (see [Get Credentials](/plugins/instagram/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **3** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/instagram/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.instagram.db..search()` and `.list()`. See [Database](/plugins/instagram/database) for filters and operators. ## Example API calls **Read-style (read):** `comments.get` ```ts theme={null} await corsair.instagram.api.comments.get({}); ``` **Write-style (write):** `carousel.post` ```ts theme={null} await corsair.instagram.api.carousel.post({}); ``` See the full list on the [API](/plugins/instagram/api) page. Use `pnpm corsair list --plugin=instagram` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/instagram/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ----------------------------------------------------- | | API | [API](/plugins/instagram/api) | | Database | [Database](/plugins/instagram/database) | | Webhooks | [Webhooks](/plugins/instagram/webhooks) | | Credentials | [Get credentials](/plugins/instagram/get-credentials) | # 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). **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 | — | ```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 } } }[] }[] ``` ```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 | — | ```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 } }[] }[] ``` ```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 | — | ```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. **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 | — | ```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 | — | ```ts theme={null} { type?: string, page?: number, per_page?: number, total_pages?: number, next?: string | null } ``` ```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 \[DESTRUCTIVE] **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 | — | ```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 }[] ``` ```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 | — | ```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 }[] ``` ```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 \[DESTRUCTIVE] **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 | — | ```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 }[] ``` ```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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 | — | ```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 }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { type?: string, id?: string, name?: string } ``` ```ts theme={null} { type?: string, id?: string } ``` *** ### delete `contacts.delete` Delete a contact \[DESTRUCTIVE] **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 | — | ```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 }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { type?: string, id: string, body?: string, author?: { type?: string, id?: string, name?: string }, contact?: { type?: string, id?: string }, created_at?: number }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { type?: string, id?: number | null } ``` ```ts theme={null} { type?: string, id?: string, subject?: string | null, body?: string | null, author?: { type?: string, id?: string } } ``` ```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 | — | ```ts theme={null} { type?: string, id?: number | null } ``` ```ts theme={null} { type?: string, id?: string, subject?: string | null, body?: string | null, author?: { type?: string, id?: string } } ``` ```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 | — | ```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 | — | ```ts theme={null} { type?: string, id?: number | null } ``` ```ts theme={null} { type?: string, id?: string, subject?: string | null, body?: string | null, author?: { type?: string, id?: string } } ``` ```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 | — | ```ts theme={null} { type?: string, id?: number | null } ``` ```ts theme={null} { type?: string, id?: string, subject?: string | null, body?: string | null, author?: { type?: string, id?: string } } ``` ```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 | — | ```ts theme={null} { type?: string, page?: number, per_page?: number, total_pages?: number, next?: string | null } ``` ```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 | — | ```ts theme={null} { type?: string, id?: number | null } ``` ```ts theme={null} { type?: string, id?: string, subject?: string | null, body?: string | null, author?: { type?: string, id?: string } } ``` ```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 | — | ```ts theme={null} { type?: string, id?: number | null } ``` ```ts theme={null} { type?: string, id?: string, subject?: string | null, body?: string | null, author?: { type?: string, id?: string } } ``` ```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 | — | ```ts theme={null} { field?: string, operator?: string, value?: string } ``` ```ts theme={null} { field?: string, order?: ascending | descending } ``` ```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 | — | ```ts theme={null} { type?: string, page?: number, per_page?: number, total_pages?: number, next?: string | null } ``` ```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 | — | ```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. **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 Intercom plugin for Corsair Use **Intercom** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 51 typed API operations * 5 database entities synced for fast `.search()` / `.list()` queries * 7 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/intercom ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { intercom } from '@corsair-dev/intercom'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [intercom()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { intercom } from '@corsair-dev/intercom'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [intercom()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/intercom/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=intercom ``` Use the key names documented in [Get Credentials](/plugins/intercom/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=intercom --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} intercom() ``` Store credentials with `pnpm corsair setup --plugin=intercom` (see [Get Credentials](/plugins/intercom/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **7** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/intercom/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.intercom.db..search()` and `.list()`. See [Database](/plugins/intercom/database) for filters and operators. ## Example API calls **Read-style (read):** `admins.get` ```ts theme={null} await corsair.intercom.api.admins.get({}); ``` **Write-style (write):** `admins.setAway` ```ts theme={null} await corsair.intercom.api.admins.setAway({}); ``` See the full list on the [API](/plugins/intercom/api) page. Use `pnpm corsair list --plugin=intercom` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/intercom/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ---------------------------------------------------- | | API | [API](/plugins/intercom/api) | | Database | [Database](/plugins/intercom/database) | | Webhooks | [Webhooks](/plugins/intercom/webhooks) | | Credentials | [Get credentials](/plugins/intercom/get-credentials) | # 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). **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 | — | ```ts theme={null} { type?: string, item: { } } ``` ```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 | — | ```ts theme={null} { type?: string, item: { } } ``` ```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 | — | ```ts theme={null} { type?: string, item: { } } ``` ```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 | — | ```ts theme={null} { type?: string, item: { } } ``` ```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 | — | ```ts theme={null} { type?: string, item: { } } ``` ```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 | — | ```ts theme={null} { type?: string, item: { } } ``` ```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 | — | ```ts theme={null} { type?: string, item: { } } ``` ```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/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. **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 | — | ```ts theme={null} { accountId?: string, displayName?: string, emailAddress?: string, active?: boolean, avatarUrls?: { } } ``` *** ### delete `comments.delete` Delete a comment from a Jira issue \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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[]` ```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 | — | ```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 | — | ```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 | — | ```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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```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 | — | | `start_at` | `number` | 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 | — | | `issues` | `object[]` | No | — | ```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 | — | ```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` ```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 | — | ```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 | — | ```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 | — | ```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[]` ```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[]` ```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 | — | ```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. **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 ``` 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 Jira plugin for Corsair Use **Jira** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 32 typed API operations * 6 database entities synced for fast `.search()` / `.list()` queries * 3 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/jira ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { jira } from '@corsair-dev/jira'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [jira()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { jira } from '@corsair-dev/jira'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [jira()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/jira/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=jira ``` Use the key names documented in [Get Credentials](/plugins/jira/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=jira --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} jira() ``` Store credentials with `pnpm corsair setup --plugin=jira` (see [Get Credentials](/plugins/jira/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **3** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/jira/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.jira.db..search()` and `.list()`. See [Database](/plugins/jira/database) for filters and operators. ## Example API calls **Read-style (read):** `comments.get` ```ts theme={null} await corsair.jira.api.comments.get({}); ``` **Write-style (write):** `comments.add` ```ts theme={null} await corsair.jira.api.comments.add({}); ``` See the full list on the [API](/plugins/jira/api) page. Use `pnpm corsair list --plugin=jira` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/jira/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------ | | API | [API](/plugins/jira/api) | | Database | [Database](/plugins/jira/database) | | Webhooks | [Webhooks](/plugins/jira/webhooks) | | Credentials | [Get credentials](/plugins/jira/get-credentials) | # 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). **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 | — | ```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 } } ``` ```ts theme={null} { accountId?: string, displayName?: string, emailAddress?: string } ``` ```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 | — | ```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 } } ``` ```ts theme={null} { accountId?: string, displayName?: string, emailAddress?: string } ``` ```ts theme={null} { id?: string, items?: { field?: string, fieldtype?: string, from?: string | null, fromString?: string | null, to?: string | null, toString?: string | null }[] } ``` ```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 | — | ```ts theme={null} { id?: string, key?: string, name?: string, description?: string, projectTypeKey?: string, lead?: { accountId?: string, displayName?: string, emailAddress?: string }, self?: string } ``` ```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/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. **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 | — | ```ts theme={null} { id: string } ``` ```ts theme={null} { id: string, name: string, displayName: string, email?: string | null } ``` ```ts theme={null} { id: string } ``` *** ### delete `comments.delete` Delete a comment \[DESTRUCTIVE] **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 | — | ```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 }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { id: string } ``` ```ts theme={null} { id: string, name: string, displayName: string, email?: string | null } ``` ```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 | — | ```ts theme={null} { id: string, name: string, type: backlog | unstarted | started | completed | canceled, color?: string, position?: number } ``` ```ts theme={null} { id: string, name: string, key: string } ``` ```ts theme={null} { id: string, name: string, displayName: string, email?: string | null } ``` ```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 | — | ```ts theme={null} { id: string, name: string, type: backlog | unstarted | started | completed | canceled, color?: string, position?: number } ``` ```ts theme={null} { id: string, name: string, key: string } ``` ```ts theme={null} { id: string, name: string, displayName: string, email?: string | null } ``` ```ts theme={null} { id: string, name: string, displayName: string, email?: string | null } ``` ```ts theme={null} { id: string, name: string, state: backlog | planned | started | paused | completed | canceled } ``` ```ts theme={null} { id: string, number: number, name?: string | null } ``` ```ts theme={null} { nodes: { id: string, name: string, color: string }[] } ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { id: string, name: string, type: backlog | unstarted | started | completed | canceled, color?: string, position?: number } ``` ```ts theme={null} { id: string, name: string, key: string } ``` ```ts theme={null} { id: string, name: string, displayName: string, email?: string | null } ``` ```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 | — | ```ts theme={null} { id: string, name: string, displayName: string, email?: string | null } ``` ```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 | — | ```ts theme={null} { id: string, name: string, displayName: string, email?: string | null } ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { id: string, name: string, displayName: string, email?: string | null } ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 }[] ``` ```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. **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 Linear plugin for Corsair Use **Linear** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 18 typed API operations * 5 database entities synced for fast `.search()` / `.list()` queries * 9 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/linear ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { linear } from '@corsair-dev/linear'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [linear()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { linear } from '@corsair-dev/linear'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [linear()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/linear/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=linear ``` Use the key names documented in [Get Credentials](/plugins/linear/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=linear --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} linear() ``` Store credentials with `pnpm corsair setup --plugin=linear` (see [Get Credentials](/plugins/linear/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ```ts corsair.ts theme={null} linear({ authType: 'oauth_2', }) ``` Store credentials with `pnpm corsair setup --plugin=linear` (see [Get Credentials](/plugins/linear/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **9** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/linear/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.linear.db..search()` and `.list()`. See [Database](/plugins/linear/database) for filters and operators. ## Example API calls **Read-style (read):** `comments.list` ```ts theme={null} await corsair.linear.api.comments.list({}); ``` **Write-style (write):** `comments.create` ```ts theme={null} await corsair.linear.api.comments.create({}); ``` See the full list on the [API](/plugins/linear/api) page. Use `pnpm corsair list --plugin=linear` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/linear/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | -------------------------------------------------- | | API | [API](/plugins/linear/api) | | Database | [Database](/plugins/linear/database) | | Webhooks | [Webhooks](/plugins/linear/webhooks) | | Credentials | [Get credentials](/plugins/linear/get-credentials) | # 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). **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 | — | ```ts theme={null} { id: string, body: string, editedAt?: string, createdAt: string, updatedAt: string, issueId: string, userId: string } ``` ```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 | — | ```ts theme={null} { id: string, body: string, editedAt?: string, createdAt: string, updatedAt: string, issueId: string, userId: string } ``` ```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 | — | ```ts theme={null} { id: string, body: string, editedAt?: string, createdAt: string, updatedAt: string, issueId: string, userId: string } ``` ```ts theme={null} { id?: string, body?: string, editedAt?: string, createdAt?: string, updatedAt?: string, issueId?: string, userId?: string } ``` ```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 | — | ```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 } ``` ```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 | — | ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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 | — | ```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 } ``` ```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 | — | ```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 } ``` ```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 | — | ```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 } ``` ```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 } ``` ```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. **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 LinkedIn plugin for Corsair Use **LinkedIn** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 22 typed API operations * 1 database entity synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/linkedin ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { linkedin } from '@corsair-dev/linkedin'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [linkedin()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { linkedin } from '@corsair-dev/linkedin'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [linkedin()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/linkedin/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=linkedin ``` Use the key names documented in [Get Credentials](/plugins/linkedin/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=linkedin --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} linkedin() ``` Store credentials with `pnpm corsair setup --plugin=linkedin` (see [Get Credentials](/plugins/linkedin/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Query synced data Synced entities support `corsair.linkedin.db..search()` and `.list()`. See [Database](/plugins/linkedin/database) for filters and operators. ## Example API calls **Read-style (read):** `ads.getAudienceCounts` ```ts theme={null} await corsair.linkedin.api.ads.getAudienceCounts({}); ``` **Write-style (write):** `comments.create` ```ts theme={null} await corsair.linkedin.api.comments.create({}); ``` See the full list on the [API](/plugins/linkedin/api) page. Use `pnpm corsair list --plugin=linkedin` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ---------------------------------------------------- | | API | [API](/plugins/linkedin/api) | | Database | [Database](/plugins/linkedin/database) | | Credentials | [Get credentials](/plugins/linkedin/get-credentials) | # 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. **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 | — | ```ts theme={null} { list_id: string, segment_opts?: { } } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { list_id: string, segment_opts?: { } } ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { company: string, address1: string, address2?: string, city: string, state: string, zip: string, country: string, phone?: string } ``` ```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 | — | ```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 | — | ```ts theme={null} { company: string, address1: string, address2?: string, city: string, state: string, zip: string, country: string, phone?: string } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { subscribe?: boolean, unsubscribe?: boolean, profile?: boolean, cleaned?: boolean, upemail?: boolean, campaign?: boolean } ``` ```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 | — | ```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 | — | ```ts theme={null} { subscribe?: boolean, unsubscribe?: boolean, profile?: boolean, cleaned?: boolean, upemail?: boolean, campaign?: boolean } ``` ```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. **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 Mailchimp plugin for Corsair Use **Mailchimp** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 56 typed API operations * 3 database entities synced for fast `.search()` / `.list()` queries * 4 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/mailchimp ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { mailchimp } from '@corsair-dev/mailchimp'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [mailchimp()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { mailchimp } from '@corsair-dev/mailchimp'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [mailchimp()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/mailchimp/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=mailchimp ``` Use the key names documented in [Get Credentials](/plugins/mailchimp/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=mailchimp --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} mailchimp() ``` Store credentials with `pnpm corsair setup --plugin=mailchimp` (see [Get Credentials](/plugins/mailchimp/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ```ts corsair.ts theme={null} mailchimp({ authType: 'api_key', }) ``` Store credentials with `pnpm corsair setup --plugin=mailchimp` (see [Get Credentials](/plugins/mailchimp/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **4** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/mailchimp/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.mailchimp.db..search()` and `.list()`. See [Database](/plugins/mailchimp/database) for filters and operators. ## Example API calls **Read-style (read):** `account.ping` ```ts theme={null} await corsair.mailchimp.api.account.ping({}); ``` **Write-style (write):** `campaigns.create` ```ts theme={null} await corsair.mailchimp.api.campaigns.create({}); ``` See the full list on the [API](/plugins/mailchimp/api) page. Use `pnpm corsair list --plugin=mailchimp` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/mailchimp/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ----------------------------------------------------- | | API | [API](/plugins/mailchimp/api) | | Database | [Database](/plugins/mailchimp/database) | | Webhooks | [Webhooks](/plugins/mailchimp/webhooks) | | Credentials | [Get credentials](/plugins/mailchimp/get-credentials) | # 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). **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 | — | ```ts theme={null} { id?: string, list_id?: string, subject?: string, status?: string } ``` ```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 | — | ```ts theme={null} { id?: string, list_id?: string, email?: string, merges?: { } } ``` ```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 | — | ```ts theme={null} { id?: string, list_id?: string, email?: string, merges?: { } } ``` ```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 | — | ```ts theme={null} { id?: string, list_id?: string, email?: string, merges?: { } } ``` ```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/monday/api API reference for Monday: 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. **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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { id: string, name: string, kind?: string, description?: string | null }[] ``` *** # Database Source: https://docs.corsair.dev/plugins/monday/database Monday local sync: searchable entities, `.search()` filters, and operators. The Monday plugin syncs data locally. Use `corsair.monday.db..search({ data, limit?, offset? })` with the filters listed per entity. **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 Monday plugin for Corsair Use **Monday** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 30 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries * 4 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/monday ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { monday } from '@corsair-dev/monday'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [monday()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { monday } from '@corsair-dev/monday'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [monday()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/monday/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=monday ``` Use the key names documented in [Get Credentials](/plugins/monday/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=monday --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} monday() ``` Store credentials with `pnpm corsair setup --plugin=monday` (see [Get Credentials](/plugins/monday/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Webhooks This plugin registers **4** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/monday/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.monday.db..search()` and `.list()`. See [Database](/plugins/monday/database) for filters and operators. ## Example API calls **Read-style (read):** `boards.get` ```ts theme={null} await corsair.monday.api.boards.get({}); ``` **Write-style (write):** `boards.archive` ```ts theme={null} await corsair.monday.api.boards.archive({}); ``` See the full list on the [API](/plugins/monday/api) page. Use `pnpm corsair list --plugin=monday` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/monday/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | -------------------------------------------------- | | API | [API](/plugins/monday/api) | | Database | [Database](/plugins/monday/database) | | Webhooks | [Webhooks](/plugins/monday/webhooks) | | Credentials | [Get credentials](/plugins/monday/get-credentials) | # Webhooks Source: https://docs.corsair.dev/plugins/monday/webhooks Monday incoming webhooks: event paths, payloads, and response data. The Monday 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). **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/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. **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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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. **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 Neon plugin for Corsair Use **Neon** through Corsair: one client, typed API calls, optional 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 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/neon ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { neon } from '@corsair-dev/neon'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [neon()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { neon } from '@corsair-dev/neon'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [neon()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/neon/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=neon ``` Use the key names documented in [Get Credentials](/plugins/neon/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=neon --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} neon() ``` Store credentials with `pnpm corsair setup --plugin=neon` (see [Get Credentials](/plugins/neon/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.neon.db..search()` and `.list()`. See [Database](/plugins/neon/database) for filters and operators. ## Example API calls **Read-style (read):** `apiKeys.listApiKeys` ```ts theme={null} await corsair.neon.api.apiKeys.listApiKeys({}); ``` **Write-style (write):** `apiKeys.createApiKey` ```ts theme={null} await corsair.neon.api.apiKeys.createApiKey({}); ``` See the full list on the [API](/plugins/neon/api) page. Use `pnpm corsair list --plugin=neon` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------ | | API | [API](/plugins/neon/api) | | Database | [Database](/plugins/neon/database) | | Credentials | [Get credentials](/plugins/neon/get-credentials) | # 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. **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 | — | ```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 | — | ```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 } }[] ``` ```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 | — | ```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 } }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { object: user, id: string } ``` ```ts theme={null} { object: user, id: string } ``` ```ts theme={null} { type: string, external?: { url: string }, file?: { url: string } } ``` ```ts theme={null} { type: string, external?: { url: string }, emoji?: string } ``` ```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 } ``` ```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 | — | ```ts theme={null} { object: user, id: string } ``` ```ts theme={null} { object: user, id: string } ``` ```ts theme={null} { type: string, external?: { url: string }, file?: { url: string } } ``` ```ts theme={null} { type: string, external?: { url: string }, emoji?: string } ``` ```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 } ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { object: user, id: string } ``` ```ts theme={null} { object: user, id: string } ``` ```ts theme={null} { type: string, external?: { url: string }, file?: { url: string } } ``` ```ts theme={null} { type: string, external?: { url: string }, emoji?: string } ``` ```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 } ``` ```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 | — | ```ts theme={null} { type: string, external?: { url: string } } ``` ```ts theme={null} { type: string, external?: { url: string }, emoji?: string } ``` ```ts theme={null} { object: user, id: string } ``` ```ts theme={null} { object: user, id: string } ``` ```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 }[] ``` ```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 }[] ``` ```ts theme={null} { } ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 }[] ``` ```ts theme={null} { } ``` *** ## Pages ### archivePage `pages.archivePage` Archive (trash) a page \[DESTRUCTIVE] **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 | — | ```ts theme={null} { object: user, id: string } ``` ```ts theme={null} { object: user, id: string } ``` ```ts theme={null} { type: string, external?: { url: string }, file?: { url: string } } ``` ```ts theme={null} { type: string, external?: { url: string }, emoji?: string } ``` ```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 } ``` ```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 | — | ```ts theme={null} { type: page_id, page_id: string } | { type: database_id, database_id: string } | { type: workspace, workspace: boolean } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { object: user, id: string } ``` ```ts theme={null} { object: user, id: string } ``` ```ts theme={null} { type: string, external?: { url: string }, file?: { url: string } } ``` ```ts theme={null} { type: string, external?: { url: string }, emoji?: string } ``` ```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 } ``` ```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 | — | ```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 } )[] ``` ```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 | — | ```ts theme={null} { object: user, id: string, type: person | bot, name?: string | null, avatar_url?: string | null }[] ``` ```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. **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 Notion plugin for Corsair Use **Notion** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 14 typed API operations * 4 database entities synced for fast `.search()` / `.list()` queries * 3 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/notion ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { notion } from '@corsair-dev/notion'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [notion()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { notion } from '@corsair-dev/notion'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [notion()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/notion/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=notion ``` Use the key names documented in [Get Credentials](/plugins/notion/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=notion --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} notion() ``` Store credentials with `pnpm corsair setup --plugin=notion` (see [Get Credentials](/plugins/notion/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ```ts corsair.ts theme={null} notion({ authType: 'oauth_2', }) ``` Store credentials with `pnpm corsair setup --plugin=notion` (see [Get Credentials](/plugins/notion/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **3** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/notion/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.notion.db..search()` and `.list()`. See [Database](/plugins/notion/database) for filters and operators. ## Example API calls **Read-style (read):** `blocks.getManyChildBlocks` ```ts theme={null} await corsair.notion.api.blocks.getManyChildBlocks({}); ``` **Write-style (write):** `blocks.appendBlock` ```ts theme={null} await corsair.notion.api.blocks.appendBlock({}); ``` See the full list on the [API](/plugins/notion/api) page. Use `pnpm corsair list --plugin=notion` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/notion/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | -------------------------------------------------- | | API | [API](/plugins/notion/api) | | Database | [Database](/plugins/notion/database) | | Webhooks | [Webhooks](/plugins/notion/webhooks) | | Credentials | [Get credentials](/plugins/notion/get-credentials) | # 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). **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 | — | ```ts theme={null} { id: string, object: string, type?: string, name?: string, avatar_url?: string }[] ``` ```ts theme={null} { id: string, object: string, type?: string, name?: string, avatar_url?: string }[] ``` ```ts theme={null} { id: string, object: string } ``` ```ts theme={null} { page_id: string, database_id: string } ``` ```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 | — | ```ts theme={null} { id: string, object: string, type?: string, name?: string, avatar_url?: string }[] ``` ```ts theme={null} { id: string, object: string, type?: string, name?: string, avatar_url?: string }[] ``` ```ts theme={null} { id: string, object: string } ``` ```ts theme={null} { page_id: string, database_id: string } ``` ```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 | — | ```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/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. **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 | ```ts theme={null} { role: string, content: string, images?: string[], tool_calls?: any[] }[] ``` ```ts theme={null} string | { } ``` ```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 | — | ```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 | ```ts theme={null} string | { } ``` ```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 | — | ```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 | ```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 | — | ```ts theme={null} { parent_model?: string, format?: string, family?: string, families?: string[], parameter_size?: string, quantization_level?: string } ``` ```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 | ```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 | — | ```ts theme={null} { index: number, message: { role: string, content: string }, finish_reason?: string | null }[] ``` ```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 | — | ```ts theme={null} { index: number, text: string, logprobs?: any | null, finish_reason?: string | null }[] ``` ```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 | — | ```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. **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 Ollama plugin for Corsair Use **Ollama** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 8 typed API operations ## Setup ```bash theme={null} pnpm install @corsair-dev/ollama ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { ollama } from '@corsair-dev/ollama'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [ollama()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { ollama } from '@corsair-dev/ollama'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [ollama()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/ollama/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=ollama ``` Use the key names documented in [Get Credentials](/plugins/ollama/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=ollama --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} ollama() ``` Store credentials with `pnpm corsair setup --plugin=ollama` (see [Get Credentials](/plugins/ollama/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ```ts corsair.ts theme={null} ollama({ authType: 'oauth_2', }) ``` Store credentials with `pnpm corsair setup --plugin=ollama` (see [Get Credentials](/plugins/ollama/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Example API calls **Read-style (read):** `models.listModels` ```ts theme={null} await corsair.ollama.api.models.listModels({}); ``` **Write-style (write):** `chat.chat` ```ts theme={null} await corsair.ollama.api.chat.chat({}); ``` See the full list on the [API](/plugins/ollama/api) page. Use `pnpm corsair list --plugin=ollama` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | -------------------------------------------------- | | API | [API](/plugins/ollama/api) | | Credentials | [Get credentials](/plugins/ollama/get-credentials) | # 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. **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 | — | ```ts theme={null} { user?: { id?: string, displayName?: string }, application?: { id?: string, displayName?: string }, device?: { id?: string, displayName?: string } } ``` ```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 | — | ```ts theme={null} { user?: { id?: string, displayName?: string }, application?: { id?: string, displayName?: string }, device?: { id?: string, displayName?: string } } ``` ```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 | — | ```ts theme={null} { user?: { id?: string, displayName?: string }, application?: { id?: string, displayName?: string }, device?: { id?: string, displayName?: string } } ``` ```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 | — | ```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 | — | ```ts theme={null} { user?: { id?: string, displayName?: string }, application?: { id?: string, displayName?: string }, device?: { id?: string, displayName?: string } } ``` ```ts theme={null} { user?: { id?: string, displayName?: string }, application?: { id?: string, displayName?: string }, device?: { id?: string, displayName?: string } } ``` ```ts theme={null} { driveId?: string, id?: string, path?: string, name?: string, siteId?: string } ``` ```ts theme={null} { mimeType?: string, hashes?: { quickXorHash?: string, sha1Hash?: string, sha256Hash?: string } } ``` ```ts theme={null} { childCount?: number } ``` ```ts theme={null} { state?: string } ``` ```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 | — | ```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 | — | ```ts theme={null} { user?: { id?: string, displayName?: string }, application?: { id?: string, displayName?: string }, device?: { id?: string, displayName?: string } } ``` ```ts theme={null} { user?: { id?: string, displayName?: string }, application?: { id?: string, displayName?: string }, device?: { id?: string, displayName?: string } } ``` ```ts theme={null} { driveId?: string, id?: string, path?: string, name?: string, siteId?: string } ``` ```ts theme={null} { mimeType?: string, hashes?: { quickXorHash?: string, sha1Hash?: string, sha256Hash?: string } } ``` ```ts theme={null} { childCount?: number } ``` ```ts theme={null} { state?: string } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { name: string, s3key: string, mimetype: string } ``` ```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 | — | ```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 | — | ```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 \[DESTRUCTIVE] **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 \[DESTRUCTIVE] **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 | — | ```ts theme={null} { user?: { id?: string, displayName?: string }, application?: { id?: string, displayName?: string }, device?: { id?: string, displayName?: string } } ``` ```ts theme={null} { user?: { id?: string, displayName?: string }, application?: { id?: string, displayName?: string }, device?: { id?: string, displayName?: string } } ``` ```ts theme={null} { driveId?: string, id?: string, path?: string, name?: string, siteId?: string } ``` ```ts theme={null} { mimeType?: string, hashes?: { quickXorHash?: string, sha1Hash?: string, sha256Hash?: string } } ``` ```ts theme={null} { childCount?: number } ``` ```ts theme={null} { state?: string } ``` ```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 | — | ```ts theme={null} { mimeType?: string } ``` ```ts theme={null} { childCount?: number } ``` ```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 | — | ```ts theme={null} { mimeType?: string } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { mimeType?: string } ``` ```ts theme={null} { childCount?: number } ``` ```ts theme={null} { state?: string } ``` ```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 | — | ```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 | — | ```ts theme={null} { contentCategory?: string } ``` ```ts theme={null} { createdDateTime?: string, lastAccessedDateTime?: string, lastModifiedDateTime?: string } ``` ```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 | — | ```ts theme={null} { createdDateTime?: string, lastAccessedDateTime?: string, lastModifiedDateTime?: string } ``` ```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 | — | ```ts theme={null} { mimeType?: string } ``` ```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 | — | ```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 | — | ```ts theme={null} { type?: string, scope?: string, webUrl?: string, webHtml?: string, preventsDownload?: boolean, application?: { id?: string, displayName?: string } } ``` ```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 } } ``` ```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 | — | ```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 \[DESTRUCTIVE] **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 \[DESTRUCTIVE] **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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 }[] }[] ``` ```ts theme={null} { user?: { id?: string, displayName?: string }, application?: { id?: string, displayName?: string }, device?: { id?: string, displayName?: string } } ``` ```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 | — | ```ts theme={null} { }[] ``` **Output** | Name | Type | Required | Description | | ------- | ---------- | -------- | ----------- | | `value` | `object[]` | Yes | — | ```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 | — | ```ts theme={null} { }[] ``` **Output** | Name | Type | Required | Description | | ------- | ---------- | -------- | ----------- | | `value` | `object[]` | Yes | — | ```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 | — | ```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 | — | ```ts theme={null} { type?: string, scope?: string, webUrl?: string, webHtml?: string, preventsDownload?: boolean, application?: { id?: string, displayName?: string } } ``` ```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 } } ``` ```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 | — | ```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 | — | ```ts theme={null} { siteId?: string, siteUrl?: string, webId?: string, webUrl?: string, listId?: string, tenantId?: string } ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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. **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 onedrive plugin for Corsair Use **Onedrive** through Corsair: one client, typed API calls, optional local DB sync, and incoming webhooks documented below. **What you get:** * 61 typed API operations * 2 database entities synced for fast `.search()` / `.list()` queries * 2 incoming webhook event types ## Setup ```bash theme={null} pnpm install @corsair-dev/onedrive ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { onedrive } from '@corsair-dev/onedrive'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [onedrive()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { onedrive } from '@corsair-dev/onedrive'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [onedrive()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/onedrive/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=onedrive ``` Use the key names documented in [Get Credentials](/plugins/onedrive/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=onedrive --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} onedrive() ``` Store credentials with `pnpm corsair setup --plugin=onedrive` (see [Get Credentials](/plugins/onedrive/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [OAuth 2.0](/concepts/oauth) ## Webhooks This plugin registers **2** webhook handler(s). Configure your provider to POST events to your Corsair HTTP endpoint, then use `webhookHooks` in the plugin factory for custom logic. See [Webhooks](/plugins/onedrive/webhooks) for every event path and payload shape, and [Webhooks concept](/concepts/webhooks) for how to set up routing. ## Query synced data Synced entities support `corsair.onedrive.db..search()` and `.list()`. See [Database](/plugins/onedrive/database) for filters and operators. ## Example API calls **Read-style (read):** `drive.get` ```ts theme={null} await corsair.onedrive.api.drive.get({}); ``` **Write-style (write):** `files.createFolder` ```ts theme={null} await corsair.onedrive.api.files.createFolder({}); ``` See the full list on the [API](/plugins/onedrive/api) page. Use `pnpm corsair list --plugin=onedrive` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and the [Webhooks](/plugins/onedrive/webhooks) page for payload types. *** ## Reference | Topic | Link | | ----------- | ---------------------------------------------------- | | API | [API](/plugins/onedrive/api) | | Database | [Database](/plugins/onedrive/database) | | Webhooks | [Webhooks](/plugins/onedrive/webhooks) | | Credentials | [Get credentials](/plugins/onedrive/get-credentials) | # 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). **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 | — | ```ts theme={null} { subscriptionId: string, changeType: string, clientState?: string, resource?: string, resourceData?: { }, tenantId?: string, subscriptionExpirationDateTime?: string }[] ``` ```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 | — | ```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 OnePassword: 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. **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 | — | ```ts theme={null} { primary?: boolean, href: string }[] ``` ```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 | — | ```ts theme={null} { id: string } ``` ```ts theme={null} { primary?: boolean, href: string }[] ``` ```ts theme={null} { id?: string, label?: string, type: string, value?: string, section?: { id: string } }[] ``` *** ### delete `items.delete` Delete an item from a vault \[DESTRUCTIVE] **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 | — | ```ts theme={null} { id: string } ``` ```ts theme={null} { primary?: boolean, href: string }[] ``` ```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[]` ```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 | — | ```ts theme={null} { primary?: boolean, href: string }[] ``` ```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 | — | ```ts theme={null} { id: string } ``` ```ts theme={null} { primary?: boolean, href: string }[] ``` ```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[]` ```ts theme={null} { id: string, name: string, description?: string, attributeVersion?: number, contentVersion?: number, type?: string }[] ``` *** # Database Source: https://docs.corsair.dev/plugins/onepassword/database OnePassword local sync: searchable entities, `.search()` filters, and operators. The OnePassword plugin syncs data locally. Use `corsair.onepassword.db..search({ data, limit?, offset? })` with the filters listed per entity. **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 OnePassword plugin for Corsair Use **OnePassword** through Corsair: one client, typed API calls, optional local DB sync. **What you get:** * 7 typed API operations * 2 database entities synced for fast `.search()` / `.list()` queries ## Setup ```bash theme={null} pnpm install @corsair-dev/onepassword ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { onepassword } from '@corsair-dev/onepassword'; export const corsair = createCorsair({ // ... other config options, multiTenancy: false, plugins: [onepassword()], }); ``` ```ts corsair.ts theme={null} import { createCorsair } from 'corsair'; import { onepassword } from '@corsair-dev/onepassword'; export const corsair = createCorsair({ // ... other config options, multiTenancy: true, plugins: [onepassword()], }); ``` See [Multi-tenancy](/concepts/multi-tenancy) for account isolation. Follow [Get Credentials](/plugins/onepassword/get-credentials) if you need help getting keys. ```bash theme={null} pnpm corsair setup --plugin=onepassword ``` Use the key names documented in [Get Credentials](/plugins/onepassword/get-credentials) (for example `api_key=`, `bot_token=`, or OAuth client fields). ```bash theme={null} pnpm corsair setup --plugin=onepassword --tenant= ``` Store per-tenant secrets after you create the tenant record. See [Multi-tenancy](/concepts/multi-tenancy). ## Authentication Each tab shows how to register the plugin for that authentication method. The default `authType` from the plugin does not need to appear in the factory call. ```ts corsair.ts theme={null} onepassword() ``` Store credentials with `pnpm corsair setup --plugin=onepassword` (see [Get Credentials](/plugins/onepassword/get-credentials) for field names). For OAuth, you typically store integration keys at the provider level and tokens per account or tenant. More: [API Key](/concepts/api-key) ## Query synced data Synced entities support `corsair.onepassword.db..search()` and `.list()`. See [Database](/plugins/onepassword/database) for filters and operators. ## Example API calls **Read-style (read):** `items.get` ```ts theme={null} await corsair.onepassword.api.items.get({}); ``` **Write-style (write):** `items.create` ```ts theme={null} await corsair.onepassword.api.items.create({}); ``` See the full list on the [API](/plugins/onepassword/api) page. Use `pnpm corsair list --plugin=onepassword` and `pnpm corsair schema ` locally to inspect schemas. *** ## Hooks Use `hooks` on API calls and `webhookHooks` on incoming events to add logging, approvals, or side effects. See [Hooks](/concepts/hooks) and [Webhooks](/concepts/webhooks) for routing and payload patterns. *** ## Reference | Topic | Link | | ----------- | ------------------------------------------------------- | | API | [API](/plugins/onepassword/api) | | Database | [Database](/plugins/onepassword/database) | | Credentials | [Get credentials](/plugins/onepassword/get-credentials) | # 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. **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 | — | ```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 } } )[] ``` ```ts theme={null} { code_interpreter?: { file_ids: string[] }, file_search?: { vector_store_ids: string[] } } ``` ```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 | — | ```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 } } )[] ``` ```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 | — | ```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 | — | ```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 } } )[] ``` ```ts theme={null} { code_interpreter?: { file_ids: string[] }, file_search?: { vector_store_ids: string[] } } ``` ```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 | — | ```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 } } )[] ``` ```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 | — | ```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 } } )[] ``` ```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 | — | ```ts theme={null} { total: number, completed: number, failed: number } ``` ```ts theme={null} { data?: { code: string, message: string, param?: string | null, line?: number | null }[] } ``` ```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 | — | ```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 | — | ```ts theme={null} { total: number, completed: number, failed: number } ``` ```ts theme={null} { data?: { code: string, message: string, param?: string | null, line?: number | null }[] } ``` ```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 | — | ```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 | — | ```ts theme={null} { total: number, completed: number, failed: number } ``` ```ts theme={null} { data?: { code: string, message: string, param?: string | null, line?: number | null }[] } ``` ```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 | — | ```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 }[] ``` ```ts theme={null} { } ``` ```ts theme={null} { type: text } | { type: json_object } | { type: json_schema, json_schema: { name: string, description?: string, schema?: { }, strict?: boolean | null } } ``` ```ts theme={null} { } ``` ```ts theme={null} { type: function, function: { name: string, description?: string, parameters?: { }, strict?: boolean | null } }[] ``` ```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 | — | ```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 }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { text: string, index: number, logprobs?: { } | null, finish_reason: string }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { }[] ``` ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------ | -------------- | -------- | ----------- | | `id` | `string` | Yes | — | | `object` | `conversation` | Yes | — | | `created_at` | `number` | Yes | — | | `metadata` | `object` | No | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ------------ | -------------- | -------- | ----------- | | `id` | `string` | Yes | — | | `object` | `conversation` | Yes | — | | `created_at` | `number` | Yes | — | | `metadata` | `object` | No | — | ```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 | — | ```ts theme={null} { object: embedding, embedding: number[] | string, index: number }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { }[] ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { code: string, message: string } ``` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { }[] ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { code: string, message: string } ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | ---------- | ---------- | -------- | ----------- | | `object` | `list` | Yes | — | | `data` | `object[]` | Yes | — | | `has_more` | `boolean` | Yes | — | ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { code: string, message: string } ``` ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { } ``` **Output** | Name | Type | Required | Description | | -------- | -------- | -------- | ----------- | | `grader` | `object` | No | — | ```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 | — | ```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 | — | ```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 | — | ```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 | — | ```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 } } )[] ``` ```ts theme={null} { file_id?: string, tools?: ( { type: code_interpreter } | { type: file_search } )[] }[] ``` ```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 | — | ```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 } } )[] ``` ```ts theme={null} { file_id?: string, tools?: ( { type: code_interpreter } | { type: file_search } )[] }[] ``` ```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 | — | ```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 | — | ```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 | — | ```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 } } )[] ``` ```ts theme={null} { file_id?: string, tools?: ( { type: code_interpreter } | { type: file_search } )[] }[] ``` ```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 | — | ```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 } } )[] ``` ```ts theme={null} { file_id?: string, tools?: ( { type: code_interpreter } | { type: file_search } )[] }[] ``` ```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 | — | ```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 | — | ```ts theme={null} string | string[] | { }[] ``` **Output** | Name | Type | Required | Description | | --------- | ---------- | -------- | ----------- | | `id` | `string` | Yes | — | | `model` | `string` | Yes | — | | `results` | `object[]` | Yes | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} string | { }[] ``` ```ts theme={null} { }[] ``` ```ts theme={null} none | auto | required | { } ``` ```ts theme={null} { } ``` ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```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 | — | ```ts theme={null} { }[] ``` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { code: string, message: string } ``` ```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 } } )[] ``` ```ts theme={null} { } ``` ```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 | — | ```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 } } )[] ``` ```ts theme={null} { } ``` ```ts theme={null} { type: auto | last_messages, last_messages?: number | null } ``` ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { code: string, message: string } ``` ```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 } } )[] ``` ```ts theme={null} { } ``` ```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 | — | ```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 | — | ```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 | — | ```ts theme={null} { } ``` ```ts theme={null} { code: string, message: string } ``` ```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 } } )[] ``` ```ts theme={null} { } ``` ```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` | Y