import { PermissionQuery } from '@unkey/rbac'; export { Flatten, and, or } from '@unkey/rbac'; import { Meter } from '@opentelemetry/api'; import { z } from 'zod'; /** * This file was auto-generated by openapi-typescript. * Do not make direct changes to the file. */ interface paths { "/v1/liveness": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["v1.liveness"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.getKey": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["getKey"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.whoami": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["whoami"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.deleteKey": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["deleteKey"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.createKey": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["createKey"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.verifyKey": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["verifyKey"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.updateKey": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["updateKey"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.updateRemaining": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["updateRemaining"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.getVerifications": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["keys.getVerifications"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.addPermissions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["addPermissions"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.removePermissions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["removePermissions"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.setPermissions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["setPermissions"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.addRoles": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["addRoles"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.removeRoles": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["removeRoles"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/keys.setRoles": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["setRoles"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/apis.getApi": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["getApi"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/apis.createApi": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["createApi"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/apis.listKeys": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["listKeys"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/apis.deleteApi": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["deleteApi"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/apis.deleteKeys": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["deleteKeys"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/ratelimits.limit": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["limit"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/ratelimits.setOverride": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["setOverride"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/ratelimits.listOverrides": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["listOverrides"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/ratelimits.deleteOverride": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["deleteOverride"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/ratelimits.getOverride": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["getOverride"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/migrations.createKeys": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["v1.migrations.createKeys"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/migrations.enqueueKeys": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["v1.migrations.enqueueKeys"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/permissions.createPermission": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["createPermission"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/permissions.deletePermission": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["deletePermission"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/permissions.getPermission": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["getPermission"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/permissions.listPermissions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["listPermissions"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/permissions.createRole": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["createRole"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/permissions.deleteRole": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["deleteRole"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/permissions.getRole": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["getRole"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/permissions.listRoles": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["listRoles"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/identities.createIdentity": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["createIdentity"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/identities.getIdentity": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["getIdentity"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/identities.listIdentities": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["listIdentities"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/identities.updateIdentity": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["updateIdentity"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/identities.deleteIdentity": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["deleteIdentity"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/analytics.getVerifications": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["getVerifications"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/legacy/keys": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["deprecated.createKey"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/legacy/keys/verify": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** @deprecated */ post: operations["deprecated.verifyKey"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/legacy/apis/{legacyApiId}/keys": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get: operations["deprecated.listKeys"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.connections.status": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get Connection Status */ get: operations["get.connections.status"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.connections.delete": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post?: never; /** Delete Connection */ delete: operations["delete.connections"]; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.connections.gocardless": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get GoCardless Connections */ get: operations["get.connections.gocardless"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.connections/{reference}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get Connection by Reference */ get: operations["get.connections.by.reference"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.connections.accounts": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get Connection Accounts */ get: operations["get.connections.accounts"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.connections.accounts.balance": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get Account Balance */ get: operations["get.connections.account.balance"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.transactions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get transactions * @description Get transactions for a specific account */ get: operations["get.transactions"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.transactions/recurring": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get recurring transactions */ get: operations["get.transactions.recurring"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.transactions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** Enrich Transactions */ post: operations["enrich-transactions"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.detailed": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Detailed Enrichment * @description Analyze a transaction in detail with enhanced attributes including frequency prediction and purpose identification */ post: operations["detailed-enrichment"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.category-prediction": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Category Prediction * @description Efficiently categorize multiple transaction descriptions with confidence scores */ post: operations["category-prediction"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.multi-model": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Multi-Model Enrichment * @description Analyze a transaction using multiple AI models and provide consensus results with confidence scoring */ post: operations["multi-model-enrichment"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.tax-category": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Tax Category Analysis (Single) * @description Classify a single transaction into tax categories based on business type and applicable tax rules */ post: operations["tax-category-single"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.tax-category/bulk": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Tax Category Analysis (Bulk) * @description Classify multiple transactions into tax categories based on business type and applicable tax rules */ post: operations["tax-category-bulk"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.business-purpose": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Business Purpose Analysis (Single) * @description Generate audit-ready business purpose statements for a single transaction */ post: operations["business-purpose-single"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.business-purpose/bulk": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Business Purpose Analysis (Bulk) * @description Generate audit-ready business purpose statements for multiple transactions */ post: operations["business-purpose-bulk"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.receipt-requirement": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Receipt Requirement Analysis (Single) * @description Determines whether a receipt is required for tax purposes, applicable thresholds, retention periods, and documentation guidance for a single transaction. */ post: operations["receipt-requirement-single"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.receipt-requirement/bulk": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Receipt Requirement Analysis (Bulk) * @description Determines whether receipts are required for tax purposes, applicable thresholds, retention periods, and documentation guidance for multiple transactions. */ post: operations["receipt-requirement-bulk"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.tax-deduction": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Tax Deduction Optimization (Single) * @description Analyzes a transaction to suggest optimal tax classifications for maximizing legitimate deductions while maintaining compliance with tax regulations. */ post: operations["tax-deduction-single"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.tax-deduction/bulk": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Tax Deduction Optimization (Bulk) * @description Analyzes multiple transactions to suggest optimal tax classifications for maximizing legitimate deductions while maintaining compliance with tax regulations. */ post: operations["tax-deduction-bulk"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.per-diem": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Per Diem Analysis (Single) * @description Determines per diem eligibility for a travel-related expense, calculates appropriate reimbursement amounts, and provides documentation guidance. */ post: operations["per-diem-analysis-single"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.per-diem/bulk": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Per Diem Analysis (Bulk) * @description Determines per diem eligibility for multiple travel-related expenses, calculates appropriate reimbursement amounts, and provides documentation guidance. */ post: operations["per-diem-analysis-bulk"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.worker-classification": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Worker Classification (Single) * @description Analyzes a payment transaction to classify the recipient as an employee or contractor */ post: operations["worker-classification-single"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.worker-classification/bulk": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Worker Classification (Bulk) * @description Analyzes multiple payment transactions to classify recipients as employees or contractors */ post: operations["worker-classification-bulk"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.analytics": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get Enrichment Analytics * @description Retrieve comprehensive analytics for enrichment API usage including costs, performance, and cache metrics */ get: operations["enrichment-analytics"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.async": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Trigger async transaction enrichment * @description Submit transactions for asynchronous enrichment processing. * This endpoint queues transactions for background processing and returns a job ID for tracking progress. * * **Features:** * - Process up to 25 transactions per request * - Multiple enrichment types available (category, merchant, website, etc.) * - Configurable priority levels and batch sizes * - Optional webhook notifications on completion * - Real-time progress tracking via status endpoint * * **Processing Time:** * - Typical completion: 30 seconds to 2 minutes depending on batch size * - High priority jobs are processed first * - Large batches are automatically split for optimal performance */ post: operations["triggerAsyncEnrichment"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.categorize.async": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Trigger async transaction categorization * @description Submit transactions for asynchronous categorization processing. * This endpoint queues transactions for background AI categorization and returns a job ID for tracking progress. * * **Features:** * - Process up to 25 transactions per request * - AI-powered category prediction with confidence scores * - Optional subcategory classification * - Configurable confidence thresholds * - Bulk processing optimization for performance * - Optional webhook notifications on completion * * **Categories Supported:** * - Business expenses: office_supplies, software, equipment, rent, etc. * - Travel: travel, meals, lodging, transportation * - Professional services: legal, accounting, consulting * - And many more based on transaction patterns * * **Processing Time:** * - Typical completion: 15-45 seconds depending on batch size * - High priority jobs are processed first * - Optimized AI model for fast categorization */ post: operations["triggerAsyncCategorization"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.categorize.status/{jobId}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get categorization job status * @description Check the status and progress of an async categorization job. * * **Job Statuses:** * - `queued`: Job is waiting in the queue * - `processing`: Job is currently being processed * - `completed`: Job finished successfully, results available * - `failed`: Job failed due to an error * - `cancelled`: Job was cancelled * * **Results:** * When status is `completed`, the response includes categorization results for all processed transactions. * Results include predicted categories, confidence scores, alternative predictions, and processing costs. */ get: operations["getCategorizationJobStatus"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enrich.status/{jobId}": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * Get enrichment job status * @description Check the status and progress of an async enrichment job. * * **Job Statuses:** * - `queued`: Job is waiting in the queue * - `processing`: Job is currently being processed * - `completed`: Job finished successfully, results available * - `failed`: Job failed due to an error * - `cancelled`: Job was cancelled * * **Results:** * When status is `completed`, the response includes enrichment results for all processed transactions. * Results include confidence scores, processing costs, and detailed enrichment data. */ get: operations["getEnrichmentJobStatus"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.health": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Health Check */ get: operations["get.health"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.institutions": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** List all financial institutions */ get: operations["get.institutions"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.institutions/{id}/usage": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; /** Update the usage of a financial institution */ put: operations["update.institutions.usage"]; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.rates": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** List all financial rates */ get: operations["get.rates"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.statements": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get Statements */ get: operations["get.statements"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.statements/pdf": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** Get Statement PDF */ get: operations["get.statements.pdf"]; put?: never; post?: never; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.gocardless/link": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** Auth link (GoCardLess) */ post: operations["post.gocardless.link"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.gocardless/agreement": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** Agreement (GoCardLess) */ post: operations["post.gocardless.agreement"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.gocardless/exchange": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** Exchange token (GoCardLess) */ post: operations["post.gocardless.exchange"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.plaid/link": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** Auth Link (Plaid) */ post: operations["post.plaid.link"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.plaid/exchange": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** Exchange token (Plaid) */ post: operations["post.plaid.exchange"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enablebanking.link": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** Auth link (EnableBanking) */ post: operations["post.enablebanking.link"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.enablebanking.exchange": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** Exchange token (EnableBanking) */ post: operations["post.enablebanking.exchange"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.stripe.connect.authorize": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Generate Stripe Connect OAuth authorization URL * @description Creates a Stripe Connect OAuth authorization URL with optional prefill parameters for user onboarding */ post: operations["v1.auth.stripe.connect.authorize"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.stripe.connect.exchange": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Exchange Stripe Connect authorization code for tokens * @description Exchanges Stripe Connect OAuth authorization code for access tokens and creates financial connection */ post: operations["v1.auth.stripe.connect.exchange"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/webhooks/stripe": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["v1.webhooks.stripe"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/webhooks/stripe/sync": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["v1.webhooks.stripe.sync"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/webhooks/plaid": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["v1.webhooks.plaid"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/webhooks/plaid/sync": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; post: operations["v1.webhooks.plaid.sync"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; "/v1/api.organizations/{orgId}/storage/bucket": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; get?: never; put?: never; /** * Provision R2 bucket for organization * @description Creates a dedicated Cloudflare R2 bucket for the specified organization with scoped access controls */ post: operations["provisionBucket"]; delete?: never; options?: never; head?: never; patch?: never; trace?: never; }; } interface components { schemas: { ErrBadRequest: { error: { /** * @description A machine readable error code. * @example BAD_REQUEST * @enum {string} */ code: "BAD_REQUEST"; /** * @description A link to our documentation with more details about this error code * @example https://solomon-ai-platform.com/docs/api-reference/errors/code/BAD_REQUEST */ docs: string; /** @description A human readable explanation of what went wrong */ message: string; /** * @description Please always include the requestId in your error report * @example req_1234 */ requestId: string; }; }; ErrUnauthorized: { error: { /** * @description A machine readable error code. * @example UNAUTHORIZED * @enum {string} */ code: "UNAUTHORIZED"; /** * @description A link to our documentation with more details about this error code * @example https://solomon-ai-platform.com/docs/api-reference/errors/code/UNAUTHORIZED */ docs: string; /** @description A human readable explanation of what went wrong */ message: string; /** * @description Please always include the requestId in your error report * @example req_1234 */ requestId: string; }; }; ErrForbidden: { error: { /** * @description A machine readable error code. * @example FORBIDDEN * @enum {string} */ code: "FORBIDDEN"; /** * @description A link to our documentation with more details about this error code * @example https://solomon-ai-platform.com/docs/api-reference/errors/code/FORBIDDEN */ docs: string; /** @description A human readable explanation of what went wrong */ message: string; /** * @description Please always include the requestId in your error report * @example req_1234 */ requestId: string; }; }; ErrNotFound: { error: { /** * @description A machine readable error code. * @example NOT_FOUND * @enum {string} */ code: "NOT_FOUND"; /** * @description A link to our documentation with more details about this error code * @example https://solomon-ai-platform.com/docs/api-reference/errors/code/NOT_FOUND */ docs: string; /** @description A human readable explanation of what went wrong */ message: string; /** * @description Please always include the requestId in your error report * @example req_1234 */ requestId: string; }; }; ErrConflict: { error: { /** * @description A machine readable error code. * @example CONFLICT * @enum {string} */ code: "CONFLICT"; /** * @description A link to our documentation with more details about this error code * @example https://solomon-ai-platform.com/docs/api-reference/errors/code/CONFLICT */ docs: string; /** @description A human readable explanation of what went wrong */ message: string; /** * @description Please always include the requestId in your error report * @example req_1234 */ requestId: string; }; }; ErrPreconditionFailed: { error: { /** * @description A machine readable error code. * @example PRECONDITION_FAILED * @enum {string} */ code: "PRECONDITION_FAILED"; /** * @description A link to our documentation with more details about this error code * @example https://solomon-ai-platform.com/docs/api-reference/errors/code/PRECONDITION_FAILED */ docs: string; /** @description A human readable explanation of what went wrong */ message: string; /** * @description Please always include the requestId in your error report * @example req_1234 */ requestId: string; }; }; ErrTooManyRequests: { error: { /** * @description A machine readable error code. * @example TOO_MANY_REQUESTS * @enum {string} */ code: "TOO_MANY_REQUESTS"; /** * @description A link to our documentation with more details about this error code * @example https://solomon-ai-platform.com/docs/api-reference/errors/code/TOO_MANY_REQUESTS */ docs: string; /** @description A human readable explanation of what went wrong */ message: string; /** * @description Please always include the requestId in your error report * @example req_1234 */ requestId: string; }; }; ErrInternalServerError: { error: { /** * @description A machine readable error code. * @example INTERNAL_SERVER_ERROR * @enum {string} */ code: "INTERNAL_SERVER_ERROR"; /** * @description A link to our documentation with more details about this error code * @example https://solomon-ai-platform.com/docs/api-reference/errors/code/INTERNAL_SERVER_ERROR */ docs: string; /** @description A human readable explanation of what went wrong */ message: string; /** * @description Please always include the requestId in your error report * @example req_1234 */ requestId: string; }; }; Key: { /** * @description The id of the key * @example key_1234 */ id: string; /** * @description The first few characters of the key to visually identify it * @example sk_5j1 */ start: string; /** * @description The id of the workspace that owns the key * @example ws_1234 */ workspaceId: string; /** * @description The id of the api that this key is for * @example api_1234 */ apiId?: string; /** * @description The name of the key, give keys a name to easily identify their purpose * @example Customer X */ name?: string; /** * @description The id of the tenant associated with this key. Use whatever reference you have in your system to identify the tenant. When verifying the key, we will send this field back to you, so you know who is accessing your API. * @example user_123 */ ownerId?: string; /** * @description Any additional metadata you want to store with the key * @example { * "roles": [ * "admin", * "user" * ], * "stripeCustomerId": "cus_1234" * } */ meta?: { [key: string]: unknown; }; /** * @description The unix timestamp in milliseconds when the key was created * @example 0 */ createdAt: number; /** * @description The unix timestamp in milliseconds when the key was last updated * @example 0 */ updatedAt?: number; /** * @description The unix timestamp in milliseconds when the key will expire. If this field is null or undefined, the key is not expiring. * @example 0 */ expires?: number; /** * @description The number of requests that can be made with this key before it becomes invalid. If this field is null or undefined, the key has no request limit. * @example 1000 */ remaining?: number; /** * @description Unkey allows you to refill remaining verifications on a key on a regular interval. * @example { * "interval": "monthly", * "amount": 10, * "refillDay": 10 * } */ refill?: { /** * @description Determines the rate at which verifications will be refilled. When 'daily' is set for 'interval' 'refillDay' will be set to null. * @example daily * @enum {string} */ interval: "daily" | "monthly"; /** * @description Resets `remaining` to this value every interval. * @example 100 */ amount: number; /** * @description The day verifications will refill each month, when interval is set to 'monthly'. Value is not zero-indexed making 1 the first day of the month. If left blank it will default to the first day of the month. When 'daily' is set for 'interval' 'refillDay' will be set to null. * @default 1 * @example 15 */ refillDay: number | null; /** * @description The unix timestamp in miliseconds when the key was last refilled. * @example 100 */ lastRefillAt?: number; }; /** * @description Unkey comes with per-key ratelimiting out of the box. * @example { * "async": true, * "limit": 10, * "duration": 60 * } */ ratelimit?: { async: boolean; /** * @description Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate. * @enum {string} */ type?: "fast" | "consistent"; /** @description The total amount of burstable requests. */ limit: number; /** @description How many tokens to refill during each refillInterval. */ refillRate?: number; /** @description Determines the speed at which tokens are refilled, in milliseconds. */ refillInterval?: number; /** @description The duration of the ratelimit window, in milliseconds. */ duration: number; }; /** * @description All roles this key belongs to * @example [ * "admin", * "finance" * ] */ roles?: string[]; /** * @description All permissions this key has * @example [ * "domain.dns.create_record", * "finance.read_receipt" * ] */ permissions?: string[]; /** * @description Sets if key is enabled or disabled. Disabled keys are not valid. * @example true */ enabled?: boolean; /** @description The key in plaintext */ plaintext?: string; /** @description The identity of the key */ identity?: { /** @description The id of the identity */ id: string; /** @description The external id of the identity */ externalId: string; /** @description Any additional metadata attached to the identity */ meta?: { [key: string]: unknown; }; }; }; V1KeysVerifyKeyResponse: { /** * @description The id of the key * @example key_1234 */ keyId?: string; /** * @description Whether the key is valid or not. * A key could be invalid for a number of reasons, for example if it has expired, has no more verifications left or if it has been deleted. * @example true */ valid: boolean; /** * @description The name of the key, give keys a name to easily identifiy their purpose * @example Customer X */ name?: string; /** * @description The id of the tenant associated with this key. Use whatever reference you have in your system to identify the tenant. When verifying the key, we will send this field back to you, so you know who is accessing your API. * @example user_123 */ ownerId?: string; /** * @description Any additional metadata you want to store with the key * @example { * "roles": [ * "admin", * "user" * ], * "stripeCustomerId": "cus_1234" * } */ meta?: { [key: string]: unknown; }; /** * @description The unix timestamp in milliseconds when the key will expire. If this field is null or undefined, the key is not expiring. * @example 123 */ expires?: number; /** * @description The ratelimit configuration for this key. If this field is null or undefined, the key has no ratelimit. * @example { * "limit": 10, * "remaining": 9, * "reset": 3600000 * } */ ratelimit?: { /** * @description Maximum number of requests that can be made inside a window * @example 10 */ limit: number; /** * @description Remaining requests after this verification * @example 9 */ remaining: number; /** * @description Unix timestamp in milliseconds when the ratelimit will reset * @example 3600000 */ reset: number; }; /** * @description The number of requests that can be made with this key before it becomes invalid. If this field is null or undefined, the key has no request limit. * @example 1000 */ remaining?: number; /** * @description A machine readable code why the key is not valid. * Possible values are: * - VALID: the key is valid and you should proceed * - NOT_FOUND: the key does not exist or has expired * - FORBIDDEN: the key is not allowed to access the api * - USAGE_EXCEEDED: the key has exceeded its request limit * - RATE_LIMITED: the key has been ratelimited * - UNAUTHORIZED: the key is not authorized * - DISABLED: the key is disabled * - INSUFFICIENT_PERMISSIONS: you do not have the required permissions to perform this action * - EXPIRED: The key was only valid for a certain time and has expired. * * These are validation codes, the HTTP status will be 200. * * @enum {string} */ code: "VALID" | "NOT_FOUND" | "FORBIDDEN" | "USAGE_EXCEEDED" | "RATE_LIMITED" | "UNAUTHORIZED" | "DISABLED" | "INSUFFICIENT_PERMISSIONS" | "EXPIRED"; /** @description Sets the key to be enabled or disabled. Disabled keys will not verify. */ enabled?: boolean; /** * @description A list of all the permissions this key is connected to. * @example [ * "dns.record.update", * "dns.record.delete" * ] */ permissions?: string[]; /** * @description A list of all the roles this key is connected to. * @example [ * "admin" * ] */ roles?: string[]; /** * @description The environment of the key, this is what what you set when you crated the key * @example test */ environment?: string; /** @description The associated identity of this key. */ identity?: { id: string; externalId: string; meta: { [key: string]: unknown; }; }; /** @description A unique id for this request, please provide it to Unkey support to help us debug your issue. */ requestId: string; }; /** @description A query for which permissions you require */ PermissionQuery: (string | { and: components["schemas"]["PermissionQuery"][]; } | { or: components["schemas"]["PermissionQuery"][]; }) | null; V1KeysVerifyKeyRequest: { /** * @description The id of the api where the key belongs to. This is optional for now but will be required soon. * The key will be verified against the api's configuration. If the key does not belong to the api, the verification will fail. * @example api_1234 */ apiId?: string; /** * @description The key to verify * @example sk_1234 */ key: string; /** * @description Tags do not influence the outcome of a verification. * They can be added to filter or aggregate historical verification data for your analytics needs. * To unkey, a tag is simply a string, we don't enforce any schema but leave that up to you. * The only exception is that each tag must be between 1 and 128 characters long. * A typical setup would be to add key-value pairs of resources or locations, that you need later when querying. * * @example [ * "path=/v1/users/123", * "region=us-east-1" * ] */ tags?: string[]; /** @description Perform RBAC checks */ authorization?: { permissions?: components["schemas"]["PermissionQuery"]; }; /** @description Customize the behaviour of deducting remaining uses. When some of your endpoints are more expensive than others, you can set a custom `cost` for each. */ remaining?: { /** * @description How many tokens should be deducted from the current `remaining` value. Set it to 0, to make it free. * @default 1 */ cost: number; }; /** * @deprecated * @description Use 'ratelimits' with `[{ name: "default", cost: 2}]` */ ratelimit?: { /** * @description Override how many tokens are deducted during the ratelimit operation. * @default 1 */ cost: number; }; /** * @description You can check against multiple ratelimits when verifying a key. Let's say you are building an app that uses AI under the hood and you want to limit your customers to 500 requests per hour, but also ensure they use up less than 20k tokens per day. * * @example [ * { * "name": "requests", * "limit": 500, * "duration": 3600000 * }, * { * "name": "tokens", * "limit": 20000, * "duration": 86400000 * } * ] */ ratelimits?: { /** * @description The name of the ratelimit. * @example tokens */ name: string; /** * @description Optionally override how expensive this operation is and how many tokens are deducted from the current limit. * @default 1 */ cost: number; /** @description Optionally override the limit. */ limit?: number; /** @description Optionally override the ratelimit window duration. */ duration?: number; }[]; }; ErrDeleteProtected: { error: { /** * @description A machine readable error code. * @example DELETE_PROTECTED * @enum {string} */ code: "DELETE_PROTECTED"; /** * @description A link to our documentation with more details about this error code * @example https://solomon-ai-platform.com/docs/api-reference/errors/code/DELETE_PROTECTED */ docs: string; /** @description A human readable explanation of what went wrong */ message: string; /** * @description Please always include the requestId in your error report * @example req_1234 */ requestId: string; }; }; TransactionSchema: { /** @example 9293961c-df93-4d6d-a2cc-fc3e353b2d10 */ id: string; /** @example Transfer to bank account */ description: string | null; /** @example other */ method: string | null; /** @example 100 */ amount: number; /** @example Vercel Inc. */ name: string; /** @example 2024-06-12 */ date: string; /** @example USD */ currency: string; /** * @example posted * @enum {string} */ status: "pending" | "posted"; /** @example travel */ category: string | null; /** @example 10000 */ balance: number | null; /** @example int_12345abcde */ internal_id: string; /** @example ba_9876fedcba */ bank_account_id: string; /** @example 1.2345 */ currency_rate: number | null; /** @example USD */ currency_source: string | null; /** @example assigned_987654 */ assigned_id?: string | null; /** @example groceries */ category_slug?: string | null; /** @example false */ manual?: boolean | null; /** @example acc_1234567890 */ account_id: string | null; /** @example John Doe */ account_owner?: string | null; /** @example USD */ iso_currency_code?: string | null; /** @example null */ unofficial_currency_code?: string | null; /** @example 22006001 */ category_id?: string | null; /** @example 2023-06-15 */ authorized_date?: string | null; /** @example 2023-06-15T14:30:00Z */ authorized_datetime?: string | null; /** @example 123 Main St */ location_address?: string | null; /** @example San Francisco */ location_city?: string | null; /** @example CA */ location_region?: string | null; /** @example 94105 */ location_postal_code?: string | null; /** @example US */ location_country?: string | null; /** @example 37.7749 */ location_lat?: number | null; /** @example -122.4194 */ location_lon?: number | null; /** @example SF-123 */ location_store_number?: string | null; /** @example Whole Foods Market */ merchant_name?: string | null; /** @example mer_12345abcde */ merchant_entity_id?: string | null; /** @example https://example.com/logos/merchant.png */ logo_url?: string | null; /** @example https://www.wholefoodsmarket.com */ website?: string | null; /** @example John Doe */ payment_meta_by_order_of?: string | null; /** @example Jane Smith */ payment_meta_payer?: string | null; /** @example Acme Corp */ payment_meta_payee?: string | null; /** @example ACH */ payment_meta_payment_method?: string | null; /** @example Stripe */ payment_meta_payment_processor?: string | null; /** @example PPD12345 */ payment_meta_ppd_id?: string | null; /** @example Monthly subscription */ payment_meta_reason?: string | null; /** @example REF987654 */ payment_meta_reference_number?: string | null; /** @example online */ payment_channel?: string | null; /** @example false */ pending?: boolean | null; /** @example ptx_12345abcde */ pending_transaction_id?: string | null; /** @example FOOD_AND_DRINK */ personal_finance_category_primary?: string | null; /** @example GROCERIES */ personal_finance_category_detailed?: string | null; /** @example HIGH */ personal_finance_category_confidence_level?: string | null; /** @example https://example.com/icons/groceries.png */ personal_finance_category_icon_url?: string | null; /** @example tx_12345abcde */ transaction_id?: string | null; /** @example TC123 */ transaction_code?: string | null; /** @example purchase */ transaction_type?: string | null; /** @example 1234 */ check_number?: string | null; }; /** @description Connection information (included when connectionId parameter was used) */ ConnectionInfoSchema: { /** * @description Connection ID * @example conn_123456789 */ id: string; /** * @description Financial data provider * @example plaid * @enum {string} */ provider: "teller" | "plaid" | "gocardless" | "stripe" | "enablebanking"; /** * @description Connection status * @example connected */ status: string; /** * @description Institution ID (provider-specific) * @example ins_123 */ institutionId: string | null; /** * @description Institution name * @example Chase Bank */ institutionName: string | null; /** * @description Connection creation timestamp * @example 2025-01-20T10:30:00Z */ createdAt: string; /** * @description Last successful sync timestamp * @example 2025-01-20T15:45:00Z */ lastSyncAt: string | null; }; TransactionsSchema: { data: components["schemas"]["TransactionSchema"][]; /** @example cursor-123 */ cursor?: string | null; /** @example false */ hasMore?: boolean | null; connection?: components["schemas"]["ConnectionInfoSchema"]; }; HealthCheckResponse: { healthy: boolean; message?: string; }; HealthSchema: { data: { search: { healthy: boolean; }; teller: components["schemas"]["HealthCheckResponse"]; gocardless: components["schemas"]["HealthCheckResponse"]; plaid: components["schemas"]["HealthCheckResponse"]; }; }; InstitutionSchema: { /** @example 9293961c-df93-4d6d-a2cc-fc3e353b2d10 */ id: string; /** @example Wells Fargo Bank */ name: string; /** @example https://cdn.solomon-ai.app/institution/9293961c-df93-4d6d-a2cc-fc3e353b2d10.jpg */ logo: string | null; /** @example 365 */ available_history?: number | null; /** * @example teller * @enum {string} */ provider: "teller" | "plaid" | "gocardless" | "stripe" | "enablebanking"; }; InstitutionsSchema: { data: components["schemas"]["InstitutionSchema"][]; connection?: components["schemas"]["ConnectionInfoSchema"]; }; UpdateUsageSchema: { data: components["schemas"]["InstitutionSchema"]; }; RatesSchema: { data: { /** @example USD */ source: string; /** @example 2024-02-29 */ date: string; /** @example { * "EUR": 0.925393, * "GBP": 0.792256, * "SEK": 10, * "BDT": 200 * } */ rates: { [key: string]: number; }; }[]; }; GoCardLessLinkSchema: { data: { /** @example https://ob.gocardless.com/psd2/start/3fa85f64-5717-4562-b3fc-2c963f66afa6/REVOLUT_REVOGB21 */ link: string; }; }; GoCardLessLinkBodySchema: { /** @example REVOLUT_REVOGB21 */ institutionId: string; /** @example http://www.yourwebpage.com */ redirect: string; /** @example 2dea1b84-97b0-4cb4-8805-302c227587c8 */ agreement: string | null; }; GoCardLessAgreementSchema: { data: { /** @example 2dea1b84-97b0-4cb4-8805-302c227587c8 */ id: string; /** @example 2024-01-01 */ created: string; /** @example 90 */ access_valid_for_days: number; /** @example 90 */ max_historical_days: number; /** @example REVOLUT_REVOGB21 */ institution_id: string; /** @example true */ accepted: boolean; }; }; GoCardLessAgreementBodySchema: { /** @example REVOLUT_REVOGB21 */ institutionId: string; /** @example 90 */ transactionTotalDays: number; }; GoCardLessExchangeSchema: { data: { /** @example 2dea1b84-97b0-4cb4-8805-302c227587c8 */ id: string; /** @example 90 */ access_valid_for_days: number; /** @example 90 */ max_historical_days: number; /** @example REVOLUT_REVOGB21 */ institution_id: string; }; }; GoCardLessExchangeBodySchema: { /** @example REVOLUT_REVOGB21 */ institutionId: string; /** @example 90 */ transactionTotalDays: number; }; PlaidLinkSchema: { data: { /** @example ojwmef9823f892n9h98h2efoqed9823hdodfcoj13er92hef */ link_token: string; /** @example 2024-06-01 */ expiration: string; }; }; PlaidLinkBodySchema: { /** @example 9293961c-df93-4d6d-a2cc-fc3e353b2d10 */ userId?: string; /** @example en */ language?: string; /** * @description Used when initiating the reconnect flow * @example ojwmef9823f892n9h98h2efoqed9823hdodfcoj13er92hef */ accessToken?: string; }; PlaidExchangeSchema: { data: { /** @example access_9293961c */ access_token: string; /** @example item_9293961c */ item_id: string; }; }; PlaidExchangeBodySchema: { /** @example ojwmef9823f892n9h98h2efoqed9823hdodfcoj13er92hef */ token: string; }; EnableBankingLinkResponseSchema: { data: { /** * @description Authorization URL to redirect the user to * @example https://auth.enablebanking.com/connect/authorize?client_id=abc123&redirect_uri=https%3A%2F%2Fapi.example.com%2Fauth%2Fcallback */ url: string; }; }; EnableBankingLinkBodySchema: { /** * @description The institution ID to link with * @example REVOLUT_GB */ institutionId: string; /** * @description Country code for the institution * @example GB */ country: string; /** * @description Team ID for the integration * @example team_123456 */ teamId: string; /** * @description Expiration date and time for the link * @example 2025-06-01T00:00:00Z */ validUntil: string; /** * @description Optional state parameter to pass through the flow * @example user_12345 */ state?: string; /** * @description Type of access being requested * @example account_information */ type?: string; }; EnableBankingExchangeSchema: { data: { /** * @description Unique session identifier * @example session_123456789 */ session_id: string; /** * @description Expiration date and time for the session * @example 2025-06-01T00:00:00Z */ expires_at: string; /** * @description Financial connection identifier * @example conn_123456789 */ connection_id: string; /** @description List of linked accounts */ accounts: { /** @example acc_123456 */ id: string; /** @example Current Account */ name: string; /** @example GBP */ currency: string; /** @example CURRENT */ type?: string; }[]; /** * @description Indicates that credentials are encrypted * @example true */ encrypted: boolean; }; }; EnableBankingExchangeBodySchema: { /** * @description Session token from EnableBanking * @example session_token_123456 */ token: string; }; StripeConnectAuthResponseSchema: { data: { /** * Format: uri * @description Stripe Connect authorization URL to redirect user to * @example https://connect.stripe.com/oauth/authorize?response_type=code&client_id=ca_123&scope=read_write */ authorization_url: string; /** * @description Stripe Connect client ID used * @example ca_FkyHCg7X8mlvCUdMDao4mMxagUfhIwXb */ client_id: string; /** * @description State parameter for verification * @example csrf_token_123 */ state?: string; }; }; StripeConnectAuthBodySchema: { /** * @description Type of business account to create * @example company * @enum {string} */ businessType?: "individual" | "company"; /** * @description Two-letter country code * @example US */ country?: string; /** * Format: email * @description User's email address to prefill * @example user@example.com */ email?: string; /** * @description Legal name of the business * @example My Business LLC */ businessName?: string; /** * Format: uri * @description Business website URL * @example https://mybusiness.com */ url?: string; /** * @description Business phone number (10 digits only) * @example 5551234567 */ phoneNumber?: string; /** * @description First name of the person * @example John */ firstName?: string; /** * @description Last name of the person * @example Doe */ lastName?: string; /** * @description Description of what the business sells * @example Online retail sales */ productDescription?: string; /** * @description Three-letter ISO currency code * @example usd */ currency?: string; /** * Format: uri * @description Custom redirect URI (must be pre-configured) * @example https://myapp.com/auth/stripe/callback */ redirectUri?: string; /** * @description State parameter for CSRF protection * @example csrf_token_123 */ state?: string; }; StripeConnectExchangeResponseSchema: { data: { /** * @description Stripe account ID for the connected account * @example acct_1234567890 */ stripe_user_id: string; /** * @description Access token for API requests (deprecated - use Stripe-Account header) * @example sk_test_123456789 */ access_token: string; /** * @description Refresh token for getting new access tokens * @example rt_123456789 */ refresh_token: string; /** * @description Publishable key for frontend integration * @example pk_test_123456789 */ stripe_publishable_key: string; /** * @description Granted scope for the connection * @example read_write */ scope: string; /** * @description Whether this is a live mode connection * @example false */ livemode: boolean; /** * @description Type of access token * @example bearer */ token_type: string; /** * @description Internal connection ID for this Stripe account * @example conn_stripe_123456 */ connection_id: string; /** * @description Whether sensitive data is encrypted * @example true */ encrypted: boolean; }; }; StripeConnectExchangeBodySchema: { /** * @description Authorization code from Stripe Connect callback * @example ac_123456789 */ code: string; /** * @description State parameter for CSRF verification * @example csrf_token_123 */ state?: string; /** * @description User-friendly name for this connection * @example My Stripe Account */ connectionName?: string; }; }; responses: never; parameters: never; requestBodies: never; headers: never; pathItems: never; } interface operations { "v1.liveness": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description The configured services and their status */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description The status of the server */ status: string; services: { /** * @description The name of the connected metrics service * @example AxiomMetrics */ metrics: string; /** * @description The name of the connected logger service * @example AxiomLogger or ConsoleLogger */ logger: string; /** @description The name of the connected ratelimit service */ ratelimit: string; /** @description The name of the connected usagelimit service */ usagelimit: string; }; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; getKey: { parameters: { query: { keyId: string; decrypt?: boolean | null; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description The configuration for a single key */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Key"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; whoami: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The actual key to fetch * @example sk_123 */ key: string; }; }; }; responses: { /** @description The configuration for a single key */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The ID of the key * @example key_123 */ id: string; /** * @description The name of the key * @example API Key 1 */ name?: string; /** * @description The remaining number of requests for the key * @example 1000 */ remaining?: number; /** @description The identity object associated with the key */ identity?: { /** * @description The identity ID associated with the key * @example id_123 */ id: string; /** * @description The external identity ID associated with the key * @example ext123 */ externalId: string; }; /** * @description Metadata associated with the key * @example { * "role": "admin", * "plan": "premium" * } */ meta?: { [key: string]: unknown; }; /** * @description The timestamp in milliseconds when the key was created * @example 1620000000000 */ createdAt: number; /** * @description Whether the key is enabled * @example true */ enabled: boolean; /** * @description The environment the key is associated with * @example production */ environment?: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; deleteKey: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The id of the key to revoke * @example key_1234 */ keyId: string; /** * @description By default Unkey soft deletes keys, so they may be recovered later. If you want to permanently delete it, set permanent=true. This might be necessary if you run into CONFLICT errors during key migration. * @default false */ permanent?: boolean; }; }; }; responses: { /** @description The key was successfully revoked, it may take up to 30s for this to take effect in all regions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": Record; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; createKey: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description Choose an `API` where this key should be created. * @example api_123 */ apiId: string; /** @description To make it easier for your users to understand which product an api key belongs to, you can add prefix them. * * For example Stripe famously prefixes their customer ids with cus_ or their api keys with sk_live_. * * The underscore is automatically added if you are defining a prefix, for example: "prefix": "abc" will result in a key like abc_xxxxxxxxx * */ prefix?: string; /** * @description The name for your Key. This is not customer facing. * @example my key */ name?: string; /** * @description The byte length used to generate your key determines its entropy as well as its length. Higher is better, but keys become longer and more annoying to handle. The default is 16 bytes, or 2^^128 possible combinations. * @default 16 */ byteLength?: number; /** * @deprecated * @description Deprecated, use `externalId` * @example team_123 */ ownerId?: string; /** * @description Your user's Id. This will provide a link between Unkey and your customer record. * When validating a key, we will return this back to you, so you can clearly identify your user from their api key. * @example team_123 */ externalId?: string; /** * @description This is a place for dynamic meta data, anything that feels useful for you should go here * @example { * "billingTier": "PRO", * "trialEnds": "2023-06-16T17:16:37.161Z" * } */ meta?: { [key: string]: unknown; }; /** * @description A list of roles that this key should have. If the role does not exist, an error is thrown * @example [ * "admin", * "finance" * ] */ roles?: string[]; /** * @description A list of permissions that this key should have. If the permission does not exist, an error is thrown * @example [ * "domains.create_record", * "say_hello" * ] */ permissions?: string[]; /** * @description You can auto expire keys by providing a unix timestamp in milliseconds. Once Keys expire they will automatically be disabled and are no longer valid unless you enable them again. * @example 1623869797161 */ expires?: number; /** * @description You can limit the number of requests a key can make. Once a key reaches 0 remaining requests, it will automatically be disabled and is no longer valid unless you update it. * @example 1000 */ remaining?: number; /** * @description Unkey enables you to refill verifications for each key at regular intervals. * @example { * "interval": "monthly", * "amount": 100, * "refillDay": 15 * } */ refill?: { /** * @description Unkey will automatically refill verifications at the set interval. * @enum {string} */ interval: "daily" | "monthly"; /** @description The number of verifications to refill for each occurrence is determined individually for each key. */ amount: number; /** @description The day of the month, when we will refill the remaining verifications. To refill on the 15th of each month, set 'refillDay': 15. * If the day does not exist, for example you specified the 30th and it's february, we will refill them on the last day of the month instead. */ refillDay?: number; }; /** * @description Unkey comes with per-key fixed-window ratelimiting out of the box. * @example { * "type": "fast", * "limit": 10, * "duration": 60000 * } */ ratelimit?: { /** * @description Async will return a response immediately, lowering latency at the cost of accuracy. Will be required soon. * @default true */ async?: boolean; /** * @deprecated * @description Deprecated, use `async`. Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate. * @default fast * @enum {string} */ type?: "fast" | "consistent"; /** @description The total amount of requests in a given interval. */ limit: number; /** * @description The window duration in milliseconds. Will be required soon. * @example 60000 */ duration?: number; /** * @deprecated * @description How many tokens to refill during each refillInterval. */ refillRate?: number; /** * @deprecated * @description The refill timeframe, in milliseconds. */ refillInterval?: number; }; /** * @description Sets if key is enabled or disabled. Disabled keys are not valid. * @default true * @example false */ enabled?: boolean; /** * @description You may want to show keys again later. While we do not recommend this, we leave this option open for you. * * In addition to storing the key's hash, recoverable keys are stored in an encrypted vault, allowing you to retrieve and display the plaintext later. * * [https://www.unkey.com/docs/security/recovering-keys](https://www.unkey.com/docs/security/recovering-keys) for more information. * @default false */ recoverable?: boolean; /** @description Environments allow you to divide your keyspace. * * Some applications like Stripe, Clerk, WorkOS and others have a concept of "live" and "test" keys to * give the developer a way to develop their own application without the risk of modifying real world * resources. * * When you set an environment, we will return it back to you when validating the key, so you can * handle it correctly. * */ environment?: string; }; }; }; responses: { /** @description The configuration for an api */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the key. This is not a secret and can be stored as a reference if you wish. You need the keyId to update or delete a key later. * @example key_123 */ keyId: string; /** * @description The newly created api key, do not store this on your own system but pass it along to your user. * @example prefix_xxxxxxxxx */ key: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; verifyKey: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": components["schemas"]["V1KeysVerifyKeyRequest"]; }; }; responses: { /** @description The verification result */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["V1KeysVerifyKeyResponse"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; updateKey: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The id of the key you want to modify * @example key_123 */ keyId: string; /** * @description The name of the key * @example Customer X */ name?: string | null; /** * @deprecated * @description Deprecated, use `externalId` * The id of the tenant associated with this key. Use whatever reference you have in your system to identify the tenant. When verifying the key, we will send this field back to you, so you know who is accessing your API. * @example user_123 */ ownerId?: string | null; /** * @description The id of the tenant associated with this key. Use whatever reference you have in your system to identify the tenant. When verifying the key, we will send this back to you, so you know who is accessing your API. * Under the hood this upserts and connects an `ìdentity` for you. * To disconnect the key from an identity, set `externalId: null`. * @example user_123 */ externalId?: string | null; /** * @description Any additional metadata you want to store with the key * @example { * "roles": [ * "admin", * "user" * ], * "stripeCustomerId": "cus_1234" * } */ meta?: { [key: string]: unknown; } | null; /** * @description The unix timestamp in milliseconds when the key will expire. If this field is null or undefined, the key is not expiring. * @example 0 */ expires?: number | null; /** * @description Unkey comes with per-key ratelimiting out of the box. Set `null` to disable. * @example { * "type": "fast", * "limit": 10, * "refillRate": 1, * "refillInterval": 60 * } */ ratelimit?: { /** * @deprecated * @description Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate. * Deprecated, use 'async' instead * @enum {string} */ type?: "fast" | "consistent"; /** * @description Asnyc ratelimiting doesn't add latency, while sync ratelimiting is slightly more accurate. * @default false */ async?: boolean; /** @description The total amount of requests allowed in a single window. */ limit: number; /** * @deprecated * @description How many tokens to refill during each refillInterval. * Deprecated, use 'limit' instead. */ refillRate?: number; /** * @deprecated * @description Determines the speed at which tokens are refilled, in milliseconds. * Deprecated, use 'duration' */ refillInterval?: number; /** @description The duration of each ratelimit window, in milliseconds. * This field will become required in a future version. */ duration?: number; } | null; /** * @description The number of requests that can be made with this key before it becomes invalid. Set `null` to disable. * @example 1000 */ remaining?: number | null; /** * @description Unkey enables you to refill verifications for each key at regular intervals. * @example { * "interval": "daily", * "amount": 100 * } */ refill?: { /** * @description Unkey will automatically refill verifications at the set interval. If null is used the refill functionality will be removed from the key. * @enum {string} */ interval: "daily" | "monthly"; /** @description The amount of verifications to refill for each occurrence is determined individually for each key. */ amount: number; /** @description The day verifications will refill each month, when interval is set to 'monthly' */ refillDay?: number; } | null; /** * @description Set if key is enabled or disabled. If disabled, the key cannot be used to verify. * @example true */ enabled?: boolean; /** * @description The roles you want to set for this key. This overwrites all existing roles. * Setting roles requires the `rbac.*.add_role_to_key` permission. * @example [ * { * "id": "perm_123" * }, * { * "name": "dns.record.create" * }, * { * "name": "dns.record.delete", * "create": true * } * ] */ roles?: { /** @description The id of the role. Provide either `id` or `name`. If both are provided `id` is used. */ id?: string; /** @description Identify the role via its name. Provide either `id` or `name`. If both are provided `id` is used. */ name?: string; /** @description Set to true to automatically create the permissions they do not exist yet. Only works when specifying `name`. * Autocreating roles requires your root key to have the `rbac.*.create_role` permission, otherwise the request will get rejected */ create?: boolean; }[]; /** * @description The permissions you want to set for this key. This overwrites all existing permissions. * Setting permissions requires the `rbac.*.add_permission_to_key` permission. * @example [ * { * "id": "perm_123" * }, * { * "name": "dns.record.create" * }, * { * "name": "dns.record.delete", * "create": true * } * ] */ permissions?: { /** @description The id of the permission. Provide either `id` or `name`. If both are provided `id` is used. */ id?: string; /** @description Identify the permission via its name. Provide either `id` or `name`. If both are provided `id` is used. */ name?: string; /** @description Set to true to automatically create the permissions they do not exist yet. Only works when specifying `name`. * Autocreating permissions requires your root key to have the `rbac.*.create_permission` permission, otherwise the request will get rejected */ create?: boolean; }[]; }; }; }; responses: { /** @description The key was successfully updated, it may take up to 30s for this to take effect in all regions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": Record; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; updateRemaining: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The id of the key you want to modify * @example key_123 */ keyId: string; /** * @description The operation you want to perform on the remaining count * @enum {string} */ op: "increment" | "decrement" | "set"; /** * @description The value you want to set, add or subtract the remaining count by * @example 1 */ value: number | null; }; }; }; responses: { /** @description The configuration for an api */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The number of remaining requests for this key after updating it. `null` means unlimited. * @example 100 */ remaining: number | null; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "keys.getVerifications": { parameters: { query?: { keyId?: string; ownerId?: string; start?: number | null; end?: number | null; granularity?: "day"; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Usage numbers over time */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { verifications: { /** * @description The timestamp of the usage data * @example 1620000000000 */ time: number; /** * @description The number of successful requests * @example 100 */ success: number; /** * @description The number of requests that were rate limited * @example 10 */ rateLimited: number; /** * @description The number of requests that exceeded the usage limit * @example 0 */ usageExceeded: number; }[]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; addPermissions: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** @description The id of the key. */ keyId: string; /** @description The permissions you want to add to this key */ permissions: { /** @description The id of the permission. Provide either `id` or `name`. If both are provided `id` is used. */ id?: string; /** @description Identify the permission via its name. Provide either `id` or `name`. If both are provided `id` is used. */ name?: string; /** @description Set to true to automatically create the permissions they do not exist yet. Only works when specifying `name`. * Autocreating permissions requires your root key to have the `rbac.*.create_permission` permission, otherwise the request will get rejected */ create?: boolean; }[]; }; }; }; responses: { /** @description All currently connected permissions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the permission. This is used internally * @example perm_123 */ id: string; /** * @description The name of the permission * @example dns.record.create */ name: string; }[]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; removePermissions: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** @description The id of the key. */ keyId: string; /** * @description The permissions you want to remove from this key. * @example [ * { * "id": "perm_123" * }, * { * "name": "dns.record.create" * } * ] */ permissions: { /** @description The id of the permission. Provide either `id` or `name`. If both are provided `id` is used. */ id?: string; /** @description Identify the permission via its name. Provide either `id` or `name`. If both are provided `id` is used. */ name?: string; }[]; }; }; }; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": Record; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; setPermissions: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** @description The id of the key. */ keyId: string; /** * @description The permissions you want to set for this key. This overwrites all existing permissions. * Setting permissions requires the `rbac.*.add_permission_to_key` permission. * @example [ * { * "id": "perm_123" * }, * { * "name": "dns.record.create" * }, * { * "name": "dns.record.delete", * "create": true * } * ] */ permissions: { /** @description The id of the permission. Provide either `id` or `name`. If both are provided `id` is used. */ id?: string; /** @description Identify the permission via its name. Provide either `id` or `name`. If both are provided `id` is used. */ name?: string; /** @description Set to true to automatically create the permissions they do not exist yet. Only works when specifying `name`. * Autocreating permissions requires your root key to have the `rbac.*.create_permission` permission, otherwise the request will get rejected */ create?: boolean; }[]; }; }; }; responses: { /** @description All currently connected permissions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the permission. This is used internally * @example perm_123 */ id: string; /** * @description The name of the permission * @example dns.record.create */ name: string; }[]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; addRoles: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** @description The id of the key. */ keyId: string; /** * @description The roles you want to set for this key. This overwrites all existing roles. * Setting roles requires the `rbac.*.add_role_to_key` permission. * @example [ * { * "id": "role_123" * }, * { * "name": "dns.record.create" * }, * { * "name": "dns.record.delete", * "create": true * } * ] */ roles: { /** @description The id of the role. Provide either `id` or `name`. If both are provided `id` is used. */ id?: string; /** @description Identify the role via its name. Provide either `id` or `name`. If both are provided `id` is used. */ name?: string; /** @description Set to true to automatically create the permissions they do not exist yet. Only works when specifying `name`. * Autocreating roles requires your root key to have the `rbac.*.create_role` permission, otherwise the request will get rejected */ create?: boolean; }[]; }; }; }; responses: { /** @description All currently connected roles */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the role. This is used internally * @example role_123 */ id: string; /** * @description The name of the role * @example dns.record.create */ name: string; }[]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; removeRoles: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** @description The id of the key. */ keyId: string; /** * @description The roles you want to remove from this key. * @example [ * { * "id": "role_123" * }, * { * "name": "dns.record.create" * } * ] */ roles: { /** @description The id of the role. Provide either `id` or `name`. If both are provided `id` is used. */ id?: string; /** @description Identify the role via its name. Provide either `id` or `name`. If both are provided `id` is used. */ name?: string; }[]; }; }; }; responses: { /** @description Success */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": Record; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; setRoles: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** @description The id of the key. */ keyId: string; /** * @description The roles you want to set for this key. This overwrites all existing roles. * Setting roles requires the `rbac.*.add_role_to_key` permission. * @example [ * { * "id": "role_123" * }, * { * "name": "dns.record.create" * }, * { * "name": "dns.record.delete", * "create": true * } * ] */ roles: { /** @description The id of the role. Provide either `id` or `name`. If both are provided `id` is used. */ id?: string; /** @description Identify the role via its name. Provide either `id` or `name`. If both are provided `id` is used. */ name?: string; /** @description Set to true to automatically create the permissions they do not exist yet. Only works when specifying `name`. * Autocreating roles requires your root key to have the `rbac.*.create_role` permission, otherwise the request will get rejected */ create?: boolean; }[]; }; }; }; responses: { /** @description All currently connected roles */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the role. This is used internally * @example role_123 */ id: string; /** * @description The name of the role * @example dns.record.create */ name: string; }[]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; getApi: { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description The configuration for an api */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the key * @example key_1234 */ id: string; /** * @description The id of the workspace that owns the api * @example ws_1234 */ workspaceId: string; /** * @description The name of the api. This is internal and your users will not see this. * @example Unkey - Production */ name?: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; createApi: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The name for your API. This is not customer facing. * @example my-api */ name: string; }; }; }; responses: { /** @description The configuration for an api */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the api * @example api_134 */ apiId: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; listKeys: { parameters: { query: { apiId: string; limit?: number; cursor?: string; ownerId?: string; externalId?: string; decrypt?: boolean | null; revalidateKeysCache?: boolean | null; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description List of keys for the api */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { keys: components["schemas"]["Key"][]; /** * @description The cursor to use for the next page of results, if no cursor is returned, there are no more results * @example eyJrZXkiOiJrZXlfMTIzNCJ9 */ cursor?: string; /** @description The total number of keys for this api. This is an approximation and may lag behind up to 5 minutes. */ total: number; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; deleteApi: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The id of the api to delete * @example api_1234 */ apiId: string; }; }; }; responses: { /** @description The api was successfully deleted, it may take up to 30s for this to take effect in all regions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": Record; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The api is protected from deletions */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrDeleteProtected"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; deleteKeys: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The id of the api, that the keys belong to. * @example api_1234 */ apiId: string; /** * @description Delete the keys permanently, if false the keys will be marked as deleted but not removed from the database. In either case, the keys will no longer be valid when verifying them. * @default false */ permanent?: boolean; }; }; }; responses: { /** @description The keys have been deleted */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description The number of keys that were deleted */ deletedKeys: number; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; limit: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description Namespaces group different limits together for better analytics. You might have a namespace for your public API and one for internal tRPC routes. * @default default * @example email.outbound */ namespace?: string; /** * @description Identifier of your user, this can be their userId, an email, an ip or anything else. * @example user_123 */ identifier: string; /** * @description How many requests may pass in a given window. * @example 10 */ limit: number; /** * @description The window duration in milliseconds * @example 60000 */ duration: number; /** * @description Expensive requests may use up more tokens. You can specify a cost to the request here and we'll deduct this many tokens in the current window. * If there are not enough tokens left, the request is denied. * * Set it to 0 to receive the current limit without changing anything. * @default 1 * @example 2 */ cost?: number; /** * @description Async will return a response immediately, lowering latency at the cost of accuracy. * @default false */ async?: boolean; /** @description Attach any metadata to this request */ meta?: { [key: string]: string | boolean | number | unknown | unknown; }; /** * @description Resources that are about to be accessed by the user * @example [ * { * "type": "project", * "id": "p_123", * "name": "dub" * } * ] */ resources?: { /** * @description The type of resource * @example organization */ type: string; /** * @description The unique identifier for the resource * @example org_123 */ id: string; /** * @description A human readable name for this resource * @example unkey */ name?: string; /** @description Attach any metadata to this resources */ meta?: { [key: string]: string | boolean | number | unknown | unknown; }; }[]; }; }; }; responses: { 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description Returns true if the request should be processed, false if it was rejected. * @example true */ success: boolean; /** * @description How many requests are allowed within a window. * @example 10 */ limit: number; /** * @description How many requests can still be made in the current window. * @example 9 */ remaining: number; /** * @description A unix millisecond timestamp when the limits reset. * @example 1709804263654 */ reset: number; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; setOverride: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The id of the namespace. Either namespaceId or namespaceName must be provided * @example rlns_1234 */ namespaceId?: string; /** * @description Namespaces group different limits together for better analytics. You might have a namespace for your public API and one for internal tRPC routes. Wildcards can also be used, more info can be found at https://www.unkey.com/docs/ratelimiting/overrides#wildcard-rules * @example email.outbound */ namespaceName?: string; /** * @description Identifier of your user, this can be their userId, an email, an ip or anything else. Wildcards ( * ) can be used to match multiple identifiers, More info can be found at https://www.unkey.com/docs/ratelimiting/overrides#wildcard-rules * @example user_123 */ identifier: string; /** * @description How many requests may pass in a given window. * @example 10 */ limit: number; /** * @description The window duration in milliseconds * @example 60000 */ duration: number; /** * @description Async will return a response immediately, lowering latency at the cost of accuracy. * @default false */ async?: boolean; }; }; }; responses: { /** @description Sucessfully created a ratelimit override */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the override. This is used internally * @example over_123 */ overrideId: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; listOverrides: { parameters: { query?: { namespaceId?: string; namespaceName?: string; limit?: number; cursor?: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description List of overrides for the given namespace. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { overrides: { id: string; identifier: string; limit: number; duration: number; async?: boolean | null; }[]; /** * @description The cursor to use for the next page of results, if no cursor is returned, there are no more results * @example eyJrZXkiOiJrZXlfMTIzNCJ9 */ cursor?: string; /** @description The total number of overrides for the namespace */ total: number; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; deleteOverride: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The id of the namespace. Either namespaceId or namespaceName must be provided * @example rlns_1234 */ namespaceId?: string; /** * @description The name of the namespace. Namespaces group different limits together for better analytics. You might have a namespace for your public API and one for internal tRPC routes. * @example email.outbound */ namespaceName?: string; /** * @description Identifier of your user, this can be their userId, an email, an ip or anything else. Wildcards ( * ) can be used to match multiple identifiers, More info can be found at https://www.unkey.com/docs/ratelimiting/overrides#wildcard-rules * @example user_123 */ identifier: string; }; }; }; responses: { /** @description Successfully deleted a ratelimit override */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": Record; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; getOverride: { parameters: { query: { namespaceId?: string; namespaceName?: string; identifier: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Details of the override for the given identifier */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { id: string; identifier: string; limit: number; duration: number; async?: boolean | null; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "v1.migrations.createKeys": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description Choose an `API` where this key should be created. * @example api_123 */ apiId: string; /** @description To make it easier for your users to understand which product an api key belongs to, you can add prefix them. * * For example Stripe famously prefixes their customer ids with cus_ or their api keys with sk_live_. * * The underscore is automatically added if you are defining a prefix, for example: "prefix": "abc" will result in a key like abc_xxxxxxxxx * */ prefix?: string; /** * @description The name for your Key. This is not customer facing. * @example my key */ name?: string; /** @description The raw key in plaintext. If provided, unkey encrypts this value and stores it securely. Provide either `hash` or `plaintext` */ plaintext?: string; /** @description Provide either `hash` or `plaintext` */ hash?: { /** @description The hashed and encoded key */ value: string; /** * @description The algorithm for hashing and encoding, currently only sha256 and base64 are supported * @enum {string} */ variant: "sha256_base64"; }; /** * @description The first 4 characters of the key. If a prefix is used, it should be the prefix plus 4 characters. * @example unkey_32kq */ start?: string; /** * @deprecated * @description Deprecated, use `externalId` * @example team_123 */ ownerId?: string; /** * @description Your user’s Id. This will provide a link between Unkey and your customer record. * When validating a key, we will return this back to you, so you can clearly identify your user from their api key. * @example user_123 */ externalId?: string; /** * @description This is a place for dynamic meta data, anything that feels useful for you should go here * @example { * "billingTier": "PRO", * "trialEnds": "2023-06-16T17:16:37.161Z" * } */ meta?: { [key: string]: unknown; }; /** * @description A list of roles that this key should have. If the role does not exist, an error is thrown * @example [ * "admin", * "finance" * ] */ roles?: string[]; /** * @description A list of permissions that this key should have. If the permission does not exist, an error is thrown * @example [ * "domains.create_record", * "say_hello" * ] */ permissions?: string[]; /** * @description You can auto expire keys by providing a unix timestamp in milliseconds. Once Keys expire they will automatically be disabled and are no longer valid unless you enable them again. * @example 1623869797161 */ expires?: number; /** * @description You can limit the number of requests a key can make. Once a key reaches 0 remaining requests, it will automatically be disabled and is no longer valid unless you update it. * @example 1000 */ remaining?: number; /** * @description Unkey enables you to refill verifications for each key at regular intervals. * @example { * "interval": "daily", * "amount": 100 * } */ refill?: { /** * @description Unkey will automatically refill verifications at the set interval. * @enum {string} */ interval: "daily" | "monthly"; /** @description The number of verifications to refill for each occurrence is determined individually for each key. */ amount: number; /** @description The day verifications will refill each month, when interval is set to 'monthly' */ refillDay?: number; }; /** * @description Unkey comes with per-key ratelimiting out of the box. * @example { * "type": "fast", * "limit": 10, * "refillRate": 1, * "refillInterval": 60 * } */ ratelimit?: { /** * @description Async will return a response immediately, lowering latency at the cost of accuracy. * @default false */ async?: boolean; /** * @deprecated * @description Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate. * @default fast * @enum {string} */ type?: "fast" | "consistent"; /** @description The total amount of burstable requests. */ limit: number; /** * @deprecated * @description How many tokens to refill during each refillInterval. */ refillRate: number; /** * @deprecated * @description Determines the speed at which tokens are refilled, in milliseconds. */ refillInterval: number; }; /** * @description Sets if key is enabled or disabled. Disabled keys are not valid. * @default true * @example false */ enabled?: boolean; /** @description Environments allow you to divide your keyspace. * * Some applications like Stripe, Clerk, WorkOS and others have a concept of "live" and "test" keys to * give the developer a way to develop their own application without the risk of modifying real world * resources. * * When you set an environment, we will return it back to you when validating the key, so you can * handle it correctly. * */ environment?: string; }[]; }; }; responses: { /** @description The key ids of all created keys */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The ids of the keys. This is not a secret and can be stored as a reference if you wish. You need the keyId to update or delete a key later. * @example [ * "key_123", * "key_456" * ] */ keyIds: string[]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "v1.migrations.enqueueKeys": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** @description Contact support@solomon-ai.app to receive your migration id. */ migrationId: string; /** @description The id of the api, you want to migrate keys to */ apiId: string; keys: { /** @description To make it easier for your users to understand which product an api key belongs to, you can add prefix them. * * For example Stripe famously prefixes their customer ids with cus_ or their api keys with sk_live_. * * The underscore is automatically added if you are defining a prefix, for example: "prefix": "abc" will result in a key like abc_xxxxxxxxx * */ prefix?: string; /** * @description The name for your Key. This is not customer facing. * @example my key */ name?: string; /** @description The raw key in plaintext. If provided, unkey encrypts this value and stores it securely. Provide either `hash` or `plaintext` */ plaintext?: string; /** @description Provide either `hash` or `plaintext` */ hash?: { /** @description The hashed and encoded key */ value: string; /** * @description The algorithm for hashing and encoding, currently only sha256 and base64 are supported * @enum {string} */ variant: "sha256_base64"; }; /** * @description The first 4 characters of the key. If a prefix is used, it should be the prefix plus 4 characters. * @example unkey_32kq */ start?: string; /** * @description Your user’s Id. This will provide a link between Unkey and your customer record. * When validating a key, we will return this back to you, so you can clearly identify your user from their api key. * @example team_123 */ ownerId?: string; /** * @description This is a place for dynamic meta data, anything that feels useful for you should go here * @example { * "billingTier": "PRO", * "trialEnds": "2023-06-16T17:16:37.161Z" * } */ meta?: { [key: string]: unknown; }; /** * @description A list of roles that this key should have. If the role does not exist, an error is thrown * @example [ * "admin", * "finance" * ] */ roles?: string[]; /** * @description A list of permissions that this key should have. If the permission does not exist, an error is thrown * @example [ * "domains.create_record", * "say_hello" * ] */ permissions?: string[]; /** * @description You can auto expire keys by providing a unix timestamp in milliseconds. Once Keys expire they will automatically be disabled and are no longer valid unless you enable them again. * @example 1623869797161 */ expires?: number; /** * @description You can limit the number of requests a key can make. Once a key reaches 0 remaining requests, it will automatically be disabled and is no longer valid unless you update it. * @example 1000 */ remaining?: number; /** * @description Unkey enables you to refill verifications for each key at regular intervals. * @example { * "interval": "daily", * "amount": 100 * } */ refill?: { /** * @description Unkey will automatically refill verifications at the set interval. * @enum {string} */ interval: "daily" | "monthly"; /** @description The number of verifications to refill for each occurrence is determined individually for each key. */ amount: number; /** @description The day verifications will refill each month, when interval is set to 'monthly' */ refillDay?: number; }; /** * @description Unkey comes with per-key fixed-window ratelimiting out of the box. * @example { * "type": "fast", * "limit": 10, * "duration": 60000 * } */ ratelimit?: { /** * @description Async will return a response immediately, lowering latency at the cost of accuracy. * @default true */ async?: boolean; /** * @deprecated * @description Deprecated, use `async`. Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate. * @default fast * @enum {string} */ type?: "fast" | "consistent"; /** @description The total amount of requests in a given interval. */ limit: number; /** * @description The window duration in milliseconds * @example 60000 */ duration: number; /** * @deprecated * @description How many tokens to refill during each refillInterval. */ refillRate?: number; /** * @deprecated * @description The refill timeframe, in milliseconds. */ refillInterval?: number; }; /** * @description Sets if key is enabled or disabled. Disabled keys are not valid. * @default true * @example false */ enabled?: boolean; /** @description Environments allow you to divide your keyspace. * * Some applications like Stripe, Clerk, WorkOS and others have a concept of "live" and "test" keys to * give the developer a way to develop their own application without the risk of modifying real world * resources. * * When you set an environment, we will return it back to you when validating the key, so you can * handle it correctly. * */ environment?: string; }[]; }; }; }; responses: { /** @description The key ids of all created keys */ 202: { headers: { [name: string]: unknown; }; content: { "application/json": Record; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; createPermission: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The unique name of your permission. * @example record.write */ name: string; /** * @description Explain what this permission does. This is just for your team, your users will not see this. * @example record.write can create new dns records for our domains. */ description?: string | ""; }; }; }; responses: { /** @description Sucessfully created a permission */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the permission. This is used internally * @example perm_123 */ permissionId: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; deletePermission: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The id of the permission you want to delete. * @example perm_123 */ permissionId: string; }; }; }; responses: { /** @description Sucessfully deleted a permission */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": Record; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; getPermission: { parameters: { query: { permissionId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description The Role */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the permission * @example perm_123 */ id: string; /** * @description The name of the permission. * @example domain.record.manager */ name: string; /** * @description The description of what this permission does. This is just for your team, your users will not see this. * @example Can manage dns records */ description?: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; listPermissions: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description The permissions in your workspace */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the permission * @example perm_123 */ id: string; /** * @description The name of the permission. * @example domain.record.manager */ name: string; /** * @description The description of what this permission does. This is just for your team, your users will not see this. * @example Can manage dns records */ description?: string; }[]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; createRole: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The unique name of your role. * @example dns.records.manager */ name: string; /** * @description Explain what this role does. This is just for your team, your users will not see this. * @example dns.records.manager can read and write dns records for our domains. */ description?: string | ""; }; }; }; responses: { /** @description Sucessfully created a role */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the role. This is used internally * @example role_123 */ roleId: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; deleteRole: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The id of the role you want to delete. * @example role_123 */ roleId: string; }; }; }; responses: { /** @description Sucessfully deleted a role */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": Record; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; getRole: { parameters: { query: { roleId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description The Role */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the role * @example role_1234 */ id: string; /** * @description The name of the role. * @example domain.record.manager */ name: string; /** * @description The description of what this role does. This is just for your team, your users will not see this. * @example Can manage dns records */ description?: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; listRoles: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description The Roles in your workspace */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the role * @example role_1234 */ id: string; /** * @description The name of the role. * @example domain.record.manager */ name: string; /** * @description The description of what this role does. This is just for your team, your users will not see this. * @example Can manage dns records */ description?: string; }[]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; createIdentity: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The id of this identity in your system. * * This usually comes from your authentication provider and could be a userId, organisationId or even an email. * It does not matter what you use, as long as it uniquely identifies something in your application. * * `externalId`s are unique across your workspace and therefore a `CONFLICT` error is returned when you try to create duplicates. * * @example user_123 */ externalId: string; /** @description Attach metadata to this identity that you need to have access to when verifying a key. * * This will be returned as part of the `verifyKey` response. * */ meta?: { [key: string]: unknown; }; /** @description Attach ratelimits to this identity. * * When verifying keys, you can specify which limits you want to use and all keys attached to this identity, will share the limits. */ ratelimits?: { /** * @description The name of this limit. You will need to use this again when verifying a key. * @example tokens */ name: string; /** * @description How many requests may pass within a given window before requests are rejected. * @example 10 */ limit: number; /** * @description The duration for each ratelimit window in milliseconds. * @example 1000 */ duration: number; }[]; }; }; }; responses: { /** @description The configuration for an api */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the identity. Used internally, you do not need to store this. * @example id_123 */ identityId: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; getIdentity: { parameters: { query?: { identityId?: string; externalId?: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description The configuration for an api */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description The id of this identity. Used to interact with unkey's API */ id: string; /** @description The id in your system */ externalId: string; /** @description The meta object defined for this identity. */ meta: { [key: string]: unknown; }; /** @description When verifying keys, you can specify which limits you want to use and all keys attached to this identity, will share the limits. */ ratelimits: { /** * @description The name of this limit. You will need to use this again when verifying a key. * @example tokens */ name: string; /** * @description How many requests may pass within a given window before requests are rejected. * @example 10 */ limit: number; /** * @description The duration for each ratelimit window in milliseconds. * @example 1000 */ duration: number; }[]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; listIdentities: { parameters: { query?: { environment?: string; limit?: number; cursor?: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description A list of identities. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description A list of identities. */ identities: { /** @description The id of this identity. Used to interact with unkey's API */ id: string; /** @description The id in your system */ externalId: string; /** @description When verifying keys, you can specify which limits you want to use and all keys attached to this identity, will share the limits. */ ratelimits: { /** * @description The name of this limit. You will need to use this again when verifying a key. * @example tokens */ name: string; /** * @description How many requests may pass within a given window before requests are rejected. * @example 10 */ limit: number; /** * @description The duration for each ratelimit window in milliseconds. * @example 1000 */ duration: number; }[]; }[]; /** * @description The cursor to use for the next page of results, if no cursor is returned, there are no more results * @example eyJrZXkiOiJrZXlfMTIzNCJ9 */ cursor?: string; /** @description The total number of identities for this environment */ total: number; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; updateIdentity: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The id of the identity to update, use either `identityId` or `externalId`, if both are provided, `identityId` takes precedence. * @example id_1234 */ identityId?: string; /** * @description The externalId of the identity to update, use either `identityId` or `externalId`, if both are provided, `identityId` takes precedence. * @example user_1234 */ externalId?: string; /** * @description This is not yet used but here for future compatibility. * @default default */ environment?: string; /** @description Attach metadata to this identity that you need to have access to when verifying a key. * * Set to `{}` to clear. * * This will be returned as part of the `verifyKey` response. * */ meta?: { [key: string]: unknown; }; /** @description Attach ratelimits to this identity. * * This overwrites all existing ratelimits on this identity. * Setting an empty array will delete all existing ratelimits. * * When verifying keys, you can specify which limits you want to use and all keys attached to this identity, will share the limits. */ ratelimits?: { /** * @description The name of this limit. You will need to use this again when verifying a key. * @example tokens */ name: string; /** * @description How many requests may pass within a given window before requests are rejected. * @example 10 */ limit: number; /** * @description The duration for each ratelimit window in milliseconds. * @example 1000 */ duration: number; }[]; }; }; }; responses: { /** @description The identity after the update. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the identity. * @example id_1234 */ id: string; /** * @description The externalId of the identity. * @example user_1234 */ externalId: string; /** * @description The metadata attached to this identity. * @example { * "stripeSubscriptionId": "sub_1234" * } */ meta: { [key: string]: unknown; }; ratelimits: { /** * @description The name of this limit. * @example tokens */ name: string; /** * @description How many requests may pass within a given window before requests are rejected. * @example 10 */ limit: number; /** * @description The duration for each ratelimit window in milliseconds. * @example 1000 */ duration: number; }[]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; deleteIdentity: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The id of the identity to delete * @example id_1234 */ identityId: string; }; }; }; responses: { /** @description The identity was successfully deleted, it may take up to 30s for this to take effect in all regions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": Record; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; getVerifications: { parameters: { query: { apiId: string; externalId?: string; keyId?: string | string[]; tag?: string | string[]; start?: number | null; end?: number | null; groupBy?: ("key" | "identity" | "tags" | "tag" | "month" | "day" | "hour") | ("key" | "identity" | "tags" | "tag" | "month" | "day" | "hour")[]; limit?: number; orderBy?: "time" | "valid" | "notFound" | "forbidden" | "usageExceeded" | "rateLimited" | "unauthorized" | "disabled" | "insufficientPermissions" | "expired" | "total"; order?: "asc" | "desc"; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Retrieve all required data to build end-user facing dashboards and drive your usage-based billing. */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description Unix timestamp in milliseconds of the start of the current time slice. */ time?: number; valid?: number; notFound?: number; forbidden?: number; usageExceeded?: number; rateLimited?: number; unauthorized?: number; disabled?: number; insufficientPermissions?: number; expired?: number; /** @description Total number of verifications in the current time slice, regardless of outcome. */ total: number; /** @description Only available when grouping by tag. */ tag?: string; /** @description Filter by one or multiple tags. If multiple tags are provided */ tags?: string[]; /** @description Only available when specifying groupBy=key in the query. * In this case there would be one datapoint per time and groupBy target. */ keyId?: string; /** @description Only available when specifying groupBy=identity in the query. * In this case there would be one datapoint per time and groupBy target. */ identity?: { id: string; externalId: string; }; }[]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "deprecated.createKey": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description Choose an `API` where this key should be created. * @example api_123 */ apiId: string; /** @description To make it easier for your users to understand which product an api key belongs to, you can add prefix them. * * For example Stripe famously prefixes their customer ids with cus_ or their api keys with sk_live_. * * The underscore is automatically added if you are defining a prefix, for example: "prefix": "abc" will result in a key like abc_xxxxxxxxx * */ prefix?: string; /** * @description The name for your Key. This is not customer facing. * @example my key */ name?: string; /** * @description The byte length used to generate your key determines its entropy as well as its length. Higher is better, but keys become longer and more annoying to handle. The default is 16 bytes, or 2^^128 possible combinations. * @default 16 */ byteLength?: number; /** * @description Your user’s Id. This will provide a link between Unkey and your customer record. * When validating a key, we will return this back to you, so you can clearly identify your user from their api key. * @example team_123 */ ownerId?: string; /** * @description This is a place for dynamic meta data, anything that feels useful for you should go here * @example { * "billingTier": "PRO", * "trialEnds": "2023-06-16T17:16:37.161Z" * } */ meta?: { [key: string]: unknown; }; /** * @description You can auto expire keys by providing a unix timestamp in milliseconds. Once Keys expire they will automatically be disabled and are no longer valid unless you enable them again. * @example 1623869797161 */ expires?: number; /** * @description You can limit the number of requests a key can make. Once a key reaches 0 remaining requests, it will automatically be disabled and is no longer valid unless you update it. * @example 1000 */ remaining?: number; /** * @description Unkey comes with per-key ratelimiting out of the box. * @example { * "type": "fast", * "limit": 10, * "refillRate": 1, * "refillInterval": 60 * } */ ratelimit?: { /** * @description Fast ratelimiting doesn't add latency, while consistent ratelimiting is more accurate. * @default fast * @enum {string} */ type?: "fast" | "consistent"; /** @description The total amount of burstable requests. */ limit: number; /** @description How many tokens to refill during each refillInterval. */ refillRate: number; /** @description Determines the speed at which tokens are refilled, in milliseconds. */ refillInterval: number; }; }; }; }; responses: { /** @description The configuration for an api */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the key. This is not a secret and can be stored as a reference if you wish. You need the keyId to update or delete a key later. * @example key_123 */ keyId: string; /** * @description The newly created api key, do not store this on your own system but pass it along to your user. * @example prefix_xxxxxxxxx */ key: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "deprecated.verifyKey": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * @description The id of the api where the key belongs to. This is optional for now but will be required soon. * The key will be verified against the api's configuration. If the key does not belong to the api, the verification will fail. * @example api_1234 */ apiId?: string; /** * @description The key to verify * @example sk_1234 */ key: string; }; }; }; responses: { /** @description The verification result */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the key * @example key_1234 */ keyId?: string; /** * @description Whether the key is valid or not. * A key could be invalid for a number of reasons, for example if it has expired, has no more verifications left or if it has been deleted. * @example true */ valid: boolean; /** * @description The name of the key, give keys a name to easily identify their purpose * @example Customer X */ name?: string; /** * @description The id of the tenant associated with this key. Use whatever reference you have in your system to identify the tenant. When verifying the key, we will send this field back to you, so you know who is accessing your API. * @example user_123 */ ownerId?: string; /** * @description Any additional metadata you want to store with the key * @example { * "roles": [ * "admin", * "user" * ], * "stripeCustomerId": "cus_1234" * } */ meta?: { [key: string]: unknown; }; /** * @description The unix timestamp in milliseconds when the key was created * @example 0 */ createdAt?: number; /** * @description The unix timestamp in milliseconds when the key will expire. If this field is null or undefined, the key is not expiring. * @example 123 */ expires?: number; /** * @description The ratelimit configuration for this key. If this field is null or undefined, the key has no ratelimit. * @example { * "limit": 10, * "remaining": 9, * "reset": 3600000 * } */ ratelimit?: { /** * @description Maximum number of requests that can be made inside a window * @example 10 */ limit: number; /** * @description Remaining requests after this verification * @example 9 */ remaining: number; /** * @description Unix timestamp in milliseconds when the ratelimit will reset * @example 3600000 */ reset: number; }; /** * @description The number of requests that can be made with this key before it becomes invalid. If this field is null or undefined, the key has no request limit. * @example 1000 */ remaining?: number; /** * @description If the key is invalid this field will be set to the reason why it is invalid. * Possible values are: * - NOT_FOUND: the key does not exist or has expired * - FORBIDDEN: the key is not allowed to access the api * - USAGE_EXCEEDED: the key has exceeded its request limit * - RATE_LIMITED: the key has been ratelimited, * - INSUFFICIENT_PERMISSIONS: you do not have the required permissions to perform this action * * @example NOT_FOUND * @enum {string} */ code?: "NOT_FOUND" | "FORBIDDEN" | "USAGE_EXCEEDED" | "RATE_LIMITED" | "UNAUTHORIZED" | "DISABLED" | "INSUFFICIENT_PERMISSIONS" | "EXPIRED"; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "deprecated.listKeys": { parameters: { query?: { limit?: number; offset?: number | null; ownerId?: string; }; header?: never; path: { legacyApiId: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Keys belonging to the api */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { keys: components["schemas"]["Key"][]; /** @description The total number of keys for this api */ total: number; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "get.connections.status": { parameters: { query: { apiId: string; id?: string; provider: "teller" | "plaid" | "gocardless" | "stripe" | "enablebanking"; accessToken?: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Retrieve connection status */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { data: { /** * @description Connection status * @example connected * @enum {string} */ status: "connected" | "disconnected"; }; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "delete.connections": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** * @description The ID of the API that the connection belongs to * @example api_1234 */ apiId: string; /** @description Connection ID */ id: string; /** * @description Provider name * @example plaid * @enum {string} */ provider: "teller" | "plaid" | "gocardless" | "stripe" | "enablebanking"; /** @description Access token (required for some providers) */ accessToken?: string; }; }; }; responses: { /** @description Connection deleted successfully */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { data: { /** * @description Success status * @example true */ success: boolean; /** * @description Success message describing what was deleted * @example Financial connection deleted successfully */ message: string; /** @description Detailed information about what was deleted */ details: { /** * @description The ID of the connection that was deleted * @example conn_123456789 */ connectionId: string; /** * @description The provider from which the connection was deleted * @example plaid */ provider: string; /** * @description Whether the connection was successfully deleted from the provider * @example true */ providerDeleted: boolean; /** * @description Whether the local database record was successfully deleted * @example true */ localRecordDeleted: boolean; }; }; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "get.connections.gocardless": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Retrieve GoCardless connections */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { data: { /** * @description Total count of connections * @example 5 */ count: number; /** * @description URL for next page * @example https://api.example.com/connections?page=2 */ next: string | null; /** * @description URL for previous page * @example null */ previous: string | null; /** @description List of requisitions */ results: { /** * @description Requisition ID * @example req_123456789 */ id: string; /** * @description Requisition reference * @example my-reference */ reference: string; /** * @description Redirect URL * @example https://example.com/callback */ redirect: string; /** * @description Requisition status * @example CR */ status: string; /** * @description Array of account IDs * @example [ * "acc_123", * "acc_456" * ] */ accounts: string[]; /** * @description Creation timestamp * @example 2025-04-24T10:30:00Z */ created: string; }[]; }; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "get.connections.by.reference": { parameters: { query: { apiId: string; }; header?: never; path: { reference: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Retrieve connection by reference */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { data: { /** * @description Connection ID * @example conn_123456789 */ id: string; /** * @description Array of account IDs * @example [ * "acc_123", * "acc_456" * ] */ accounts: string[]; }; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "get.connections.accounts": { parameters: { query: { apiId: string; id?: string; provider: "teller" | "plaid" | "gocardless" | "stripe" | "enablebanking"; accessToken?: string; institutionId?: string; stripeAccountId?: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Retrieve accounts for a connection */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description List of accounts */ data: { /** * @description Account ID * @example acc_123456789 */ id: string; /** * @description Account name * @example Checking Account */ name: string; /** * @description Account currency * @example USD */ currency: string; /** * @description Account type * @example depository */ type: string; /** @description Institution information */ institution: { /** * @description Institution ID * @example ins_123 */ id: string; /** * @description Institution name * @example Bank of Example */ name: string; /** * @description Institution logo URL * @example https://example.com/logo.png */ logo: string; /** * @description Provider name * @example plaid */ provider: string; }; /** @description Account balance information */ balance: { /** * @description Account balance amount * @example 1000.5 */ amount: number; /** * @description Balance currency * @example USD */ currency: string; /** * @description Available balance * @example 950.5 */ available: number; }; /** * @description Enrollment ID (Teller-specific) * @example null */ enrollment_id: string | null; }[]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "get.connections.account.balance": { parameters: { query: { apiId: string; accountId: string; provider: "teller" | "plaid" | "gocardless" | "stripe" | "enablebanking"; accessToken?: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Retrieve account balance */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description Account balance information */ data: { /** * @description Balance currency * @example USD */ currency: string; /** * @description Account balance amount * @example 1000.5 */ amount: number; }; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "get.transactions": { parameters: { query: { apiId: string; connectionId?: string; provider?: "teller" | "plaid" | "gocardless" | "stripe" | "enablebanking"; accountId: string; accountType?: "credit" | "depository" | "other_asset" | "loan" | "other_liability"; accessToken?: string; latest?: "true" | "false"; syncCursor?: string | null; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Retrieve transactions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["TransactionsSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "get.transactions.recurring": { parameters: { query: { apiId: string; provider: "plaid"; accessToken: string; accountId: string; userId: string; teamId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Retrieve recurring transactions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { inflow: { /** @example acc_123456789 */ account_id: string; /** @example rec_tx_987654321 */ stream_id: string; /** @example [ * "groceries", * "food" * ] */ category: string[]; category_id: string; /** @example Monthly Subscription */ description: string; /** @example Netflix */ merchant_name: string | null; /** @example 2023-01-15 */ first_date: string; /** @example 2023-12-15 */ last_date: string; /** * @example monthly * @enum {string} */ frequency: "weekly" | "bi-weekly" | "monthly" | "yearly" | "semi-monthly" | "unknown"; /** @example [ * "tx_123", * "tx_456", * "tx_789" * ] */ transaction_ids: string[]; average_amount: { /** @example 100.5 */ amount: number; /** @example USD */ iso_currency_code: string | null; /** @example null */ unofficial_currency_code: string | null; }; last_amount: { /** @example 100.5 */ amount: number; /** @example USD */ iso_currency_code: string | null; /** @example null */ unofficial_currency_code: string | null; }; /** @example true */ is_active: boolean; /** * @example mature * @enum {string} */ status: "mature" | "early_detection" | "tombstoned" | "unknown"; personal_finance_category: { /** @example FOOD_AND_DRINK */ primary: string; /** @example RESTAURANTS */ detailed: string; /** @example HIGH */ confidence_level: string; } | null; /** @example false */ is_user_modified: boolean; /** @example null */ last_user_modified_datetime: string | null; }[]; outflow: { /** @example acc_123456789 */ account_id: string; /** @example rec_tx_987654321 */ stream_id: string; /** @example [ * "groceries", * "food" * ] */ category: string[]; category_id: string; /** @example Monthly Subscription */ description: string; /** @example Netflix */ merchant_name: string | null; /** @example 2023-01-15 */ first_date: string; /** @example 2023-12-15 */ last_date: string; /** * @example monthly * @enum {string} */ frequency: "weekly" | "bi-weekly" | "monthly" | "yearly" | "semi-monthly" | "unknown"; /** @example [ * "tx_123", * "tx_456", * "tx_789" * ] */ transaction_ids: string[]; average_amount: { /** @example 100.5 */ amount: number; /** @example USD */ iso_currency_code: string | null; /** @example null */ unofficial_currency_code: string | null; }; last_amount: { /** @example 100.5 */ amount: number; /** @example USD */ iso_currency_code: string | null; /** @example null */ unofficial_currency_code: string | null; }; /** @example true */ is_active: boolean; /** * @example mature * @enum {string} */ status: "mature" | "early_detection" | "tombstoned" | "unknown"; personal_finance_category: { /** @example FOOD_AND_DRINK */ primary: string; /** @example RESTAURANTS */ detailed: string; /** @example HIGH */ confidence_level: string; } | null; /** @example false */ is_user_modified: boolean; /** @example null */ last_user_modified_datetime: string | null; }[]; /** @example 2023-06-15T14:30:00Z */ last_updated_at: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "enrich-transactions": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The transactions to enrich */ data: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example AMAZON.COM*XY1234AB */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 49.99 */ amount: number; /** * @description The category of the transaction * @example shopping */ category?: string; }[]; }; }; }; responses: { /** @description Enrich transaction data with AI-powered analysis */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { data: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The category of the transaction * @example software */ category: string | null; /** * @description The company name * @example Amazon */ company: string | null; /** * Format: uri * @description The website of the company * @example https://amazon.com */ website: string | null; /** * @description Whether the transaction is a recurring subscription payment * @example true */ subscription: boolean; }[]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "detailed-enrichment": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The transaction to analyze in detail */ transaction: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example AMAZON.COM*XY1234AB */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 49.99 */ amount: number; /** * @description The category of the transaction * @example shopping */ category?: string; }; }; }; }; responses: { /** @description Perform detailed enrichment on transaction data */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The category of the transaction * @example software */ category: string | null; /** * @description The company name * @example Amazon */ company: string | null; /** * Format: uri * @description The website of the company * @example https://amazon.com */ website: string | null; /** * @description Whether the transaction is a recurring subscription payment * @example true */ subscription: boolean; /** * @description A detailed analysis of the transaction * @example This appears to be a monthly subscription to Amazon Prime Video service. */ description: string; /** * @description The likely frequency of this transaction if it's recurring * @example monthly * @enum {string} */ frequency: "one-time" | "weekly" | "monthly" | "quarterly" | "annual" | "unknown"; /** * @description The likely purpose or use-case of this expense * @example Entertainment/Streaming Service */ purpose: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "category-prediction": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** * @description The transaction descriptions to categorize * @example [ * "NETFLIX SUBSCRIPTION", * "UBER TRIP 12345", * "AMZN MKTP US*AB12CD3DE" * ] */ descriptions: string[]; }; }; }; responses: { /** @description Predict categories for transactions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description The predicted categories for each transaction description */ categories: { /** * @description The original transaction description * @example NETFLIX SUBSCRIPTION */ description: string; /** * @description The predicted category * @example software */ category: string; /** * @description Confidence score for the prediction, from 0 to 1 * @example 0.95 */ confidence: number; }[]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "multi-model-enrichment": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The transaction to analyze with multiple models */ transaction: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example AMAZON.COM*XY1234AB */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 49.99 */ amount: number; /** * @description The category of the transaction * @example shopping */ category?: string; }; }; }; }; responses: { /** @description Apply multiple enrichment models to transaction data */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description The primary model's prediction */ primary: { /** * @description The primary category of the transaction * @example software */ category: string | null; /** * @description The company name * @example Amazon */ company: string | null; /** * Format: uri * @description The website of the company * @example https://amazon.com */ website: string | null; /** * @description Whether the transaction is a recurring subscription payment * @example true */ subscription: boolean; }; /** @description Alternative predictions from other models */ alternatives?: { /** * @description The model that produced this result * @example gpt-3.5 */ source: string; /** * @description The category of the transaction according to this model * @example shopping */ category: string | null; /** * @description The company name according to this model * @example Amazon */ company: string | null; /** * Format: uri * @description The website of the company according to this model * @example https://amazon.com */ website: string | null; /** * @description Whether this model thinks the transaction is a recurring subscription payment * @example false */ subscription: boolean; }[]; /** @description Consensus results from combining multiple model outputs */ consensus: { /** * @description The consensus category across all models * @example software */ category: string | null; /** * @description The consensus company name across all models * @example Amazon */ company: string | null; /** * @description The confidence level in the consensus result * @example 0.85 */ confidence: number; }; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "tax-category-single": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The transaction to classify for tax purposes */ transaction: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example OFFICE DEPOT #1234 */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 89.99 */ amount: number; /** * @description The category of the transaction * @example office_supplies */ category?: string; }; /** * @description The country code for tax rules to apply (ISO 3166-1 alpha-2) * @example US */ countryCode: string; /** * @description The tax year to apply rules for * @example 2025 */ taxYear: number; /** * @description The type of business entity * @example llc * @enum {string} */ businessType: "sole_proprietor" | "llc" | "s_corp" | "c_corp" | "partnership" | "non_profit"; }; }; }; responses: { /** @description Tax category classification for a single transaction */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The tax category classification * @example office_supplies_and_equipment */ taxCategory: string; /** * @description Reference to the tax form and line item * @example Schedule C Line 18 */ scheduleReference: string; /** * @description Percentage of the transaction that is tax deductible * @example 100 */ deductibilityPercent: number; /** * @description Confidence in the tax classification (0-1) * @example 0.95 */ confidence: number; /** * @description Additional notes about the tax classification * @example Fully deductible office supply expense */ notes: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "tax-category-bulk": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The transactions to classify for tax purposes */ transactions: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example OFFICE DEPOT #1234 */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 89.99 */ amount: number; /** * @description The category of the transaction * @example office_supplies */ category?: string; }[]; /** * @description The country code for tax rules to apply (ISO 3166-1 alpha-2) * @example US */ countryCode: string; /** * @description The tax year to apply rules for * @example 2025 */ taxYear: number; /** * @description The type of business entity * @example llc * @enum {string} */ businessType: "sole_proprietor" | "llc" | "s_corp" | "c_corp" | "partnership" | "non_profit"; }; }; }; responses: { /** @description Tax category classification for multiple transactions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description Tax classification results for each transaction */ results: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The tax category classification * @example office_supplies_and_equipment */ taxCategory: string; /** * @description Reference to the tax form and line item * @example Schedule C Line 18 */ scheduleReference: string; /** * @description Percentage of the transaction that is tax deductible * @example 100 */ deductibilityPercent: number; /** * @description Confidence in the tax classification (0-1) * @example 0.95 */ confidence: number; /** * @description Additional notes about the tax classification * @example Fully deductible office supply expense */ notes: string; }[]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "business-purpose-single": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The transaction to generate a business purpose for */ transaction: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example OFFICE DEPOT #1234 */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 89.99 */ amount: number; /** * @description The category of the transaction * @example office_supplies */ category?: string; }; /** * @description The country code for tax audit requirements (ISO 3166-1 alpha-2) * @example US */ countryCode: string; /** * @description Additional business context to help generate more accurate purpose statements * @example Software development company with remote employees */ businessContext?: string; }; }; }; responses: { /** @description Business purpose details for a single transaction */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description A concise business purpose statement suitable for ledgers and accounting systems * @example Office supplies for development team */ shortPurpose: string; /** * @description A detailed business purpose statement suitable for tax audits * @example Purchase of office supplies including notebooks, pens, and markers for the software development team to use during sprint planning and retrospective sessions. */ detailedPurpose: string; /** * @description The business nexus or connection to business operations * @example Direct business expense for core operations */ taxNexus: string; /** * @description Clear statement of how the expense benefits the business * @example Enables team collaboration and project documentation */ businessBenefit: string; /** * @description Flag indicating if the transaction may have personal elements * @example false */ isPersonal: boolean; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "business-purpose-bulk": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The transactions to generate business purposes for */ transactions: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example OFFICE DEPOT #1234 */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 89.99 */ amount: number; /** * @description The category of the transaction * @example office_supplies */ category?: string; }[]; /** * @description The country code for tax audit requirements (ISO 3166-1 alpha-2) * @example US */ countryCode: string; /** * @description Additional business context to help generate more accurate purpose statements * @example Software development company with remote employees */ businessContext?: string; }; }; }; responses: { /** @description Business purpose details for multiple transactions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description Business purpose results for each transaction */ results: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description A concise business purpose statement suitable for ledgers and accounting systems * @example Office supplies for development team */ shortPurpose: string; /** * @description A detailed business purpose statement suitable for tax audits * @example Purchase of office supplies including notebooks, pens, and markers for the software development team to use during sprint planning and retrospective sessions. */ detailedPurpose: string; /** * @description The business nexus or connection to business operations * @example Direct business expense for core operations */ taxNexus: string; /** * @description Clear statement of how the expense benefits the business * @example Enables team collaboration and project documentation */ businessBenefit: string; /** * @description Flag indicating if the transaction may have personal elements * @example false */ isPersonal: boolean; }[]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "receipt-requirement-single": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The transaction to analyze for receipt requirements */ transaction: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example OFFICE DEPOT #1234 */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 89.99 */ amount: number; /** * @description The category of the transaction * @example office_supplies */ category?: string; }; /** * @description The country code for tax receipt requirements (ISO 3166-1 alpha-2) * @example US */ countryCode: string; /** * @description The tax year to apply rules for * @example 2025 */ taxYear: number; /** * @description The type of business entity * @example llc * @enum {string} */ businessType: "sole_proprietor" | "llc" | "s_corp" | "c_corp" | "partnership" | "non_profit"; }; }; }; responses: { /** @description Receipt requirement analysis successfully generated */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description Whether a receipt is required for this transaction * @example true */ receiptRequired: boolean; /** * @description The threshold amount above which receipts are required * @example 75 */ receiptThreshold: number; /** * @description Number of years receipts should be retained * @example 7 */ receiptRetentionPeriod: number; /** * @description Reference to the specific tax regulation requiring receipts * @example IRS Publication 463 */ regulationReference: string; /** * @description Additional documentation that may be required beyond the receipt * @example [ * "Proof of business purpose", * "Attendance list for meals" * ] */ additionalDocumentation: string[]; /** * @description Additional notes about receipt requirements * @example For meals, note business purpose and attendees on the receipt */ notes: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "receipt-requirement-bulk": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The transactions to analyze for receipt requirements */ transactions: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example OFFICE DEPOT #1234 */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 89.99 */ amount: number; /** * @description The category of the transaction * @example office_supplies */ category?: string; }[]; /** * @description The country code for tax receipt requirements (ISO 3166-1 alpha-2) * @example US */ countryCode: string; /** * @description The tax year to apply rules for * @example 2025 */ taxYear: number; /** * @description The type of business entity * @example llc * @enum {string} */ businessType: "sole_proprietor" | "llc" | "s_corp" | "c_corp" | "partnership" | "non_profit"; }; }; }; responses: { /** @description Receipt requirement analysis successfully generated for all transactions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description Receipt requirement results for each transaction */ results: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description Whether a receipt is required for this transaction * @example true */ receiptRequired: boolean; /** * @description The threshold amount above which receipts are required * @example 75 */ receiptThreshold: number; /** * @description Number of years receipts should be retained * @example 7 */ receiptRetentionPeriod: number; /** * @description Reference to the specific tax regulation requiring receipts * @example IRS Publication 463 */ regulationReference: string; /** * @description Additional documentation that may be required beyond the receipt * @example [ * "Proof of business purpose", * "Attendance list for meals" * ] */ additionalDocumentation: string[]; /** * @description Additional notes about receipt requirements * @example For meals, note business purpose and attendees on the receipt */ notes: string; }[]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "tax-deduction-single": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The transaction to analyze for tax deduction optimization */ transaction: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example OFFICE DEPOT #1234 */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 89.99 */ amount: number; /** * @description The category of the transaction * @example office_supplies */ category?: string; }; /** * @description The country code for tax rules (ISO 3166-1 alpha-2) * @example US */ countryCode: string; /** * @description The tax year to apply rules for * @example 2025 */ taxYear: number; /** * @description The type of business entity * @example llc * @enum {string} */ businessType: "sole_proprietor" | "llc" | "s_corp" | "c_corp" | "partnership" | "non_profit"; /** * @description The transaction's current tax classification, if any * @example office_supplies */ currentClassification?: string; }; }; }; responses: { /** @description Tax deduction optimization successfully generated */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The transaction's current tax classification * @example office_supplies */ currentClassification: string | null; /** * @description The optimal tax classification for maximum deduction * @example home_office_expense */ optimalClassification: string; /** * @description Potential percentage increase in deduction amount * @example 15 */ deductionIncrease: number; /** * @description Explanation for the suggested optimization * @example Classifying as home office expense provides a higher deduction rate */ optimizationRationale: string; /** * @description Additional documentation or requirements for the optimal classification * @example [ * "Home office measurement documentation", * "Exclusive use certification" * ] */ additionalRequirements: string[]; /** * @description Potential audit risks associated with the optimization * @example Low risk - common reclassification with proper documentation */ risks: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "tax-deduction-bulk": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The transactions to analyze for tax deduction optimization */ transactions: { transaction: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example OFFICE DEPOT #1234 */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 89.99 */ amount: number; /** * @description The category of the transaction * @example office_supplies */ category?: string; }; currentClassification?: string; }[]; /** * @description The country code for tax rules (ISO 3166-1 alpha-2) * @example US */ countryCode: string; /** * @description The tax year to apply rules for * @example 2025 */ taxYear: number; /** * @description The type of business entity * @example llc * @enum {string} */ businessType: "sole_proprietor" | "llc" | "s_corp" | "c_corp" | "partnership" | "non_profit"; }; }; }; responses: { /** @description Tax deduction optimization successfully generated for all transactions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description Tax deduction optimization results for each transaction */ results: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The transaction's current tax classification * @example office_supplies */ currentClassification: string | null; /** * @description The optimal tax classification for maximum deduction * @example home_office_expense */ optimalClassification: string; /** * @description Potential percentage increase in deduction amount * @example 15 */ deductionIncrease: number; /** * @description Explanation for the suggested optimization * @example Classifying as home office expense provides a higher deduction rate */ optimizationRationale: string; /** * @description Additional documentation or requirements for the optimal classification * @example [ * "Home office measurement documentation", * "Exclusive use certification" * ] */ additionalRequirements: string[]; /** * @description Potential audit risks associated with the optimization * @example Low risk - common reclassification with proper documentation */ risks: string; }[]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "per-diem-analysis-single": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The transaction to analyze for per diem eligibility */ transaction: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example OFFICE DEPOT #1234 */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 89.99 */ amount: number; /** * @description The category of the transaction * @example office_supplies */ category?: string; }; /** * @description The country code for per diem rates (ISO 3166-1 alpha-2) * @example US */ countryCode: string; /** * @description The location where the expense occurred (city or region) * @example San Francisco, CA */ location: string; /** @description The start and end dates of the business travel */ travelDates: { /** * @description Start date of the business travel * @example 2025-04-20T00:00:00Z */ startDate: string | null; /** * @description End date of the business travel * @example 2025-04-23T00:00:00Z */ endDate: string | null; }; /** * @description The type of expense * @example meals * @enum {string} */ expenseType: "lodging" | "meals" | "incidental" | "transportation" | "other"; }; }; }; responses: { /** @description Per diem analysis successfully generated */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description Whether the transaction is eligible for per diem * @example true */ eligibleForPerDiem: boolean; /** * @description The type of expense * @example meals * @enum {string} */ expenseType: "lodging" | "meals" | "incidental" | "transportation" | "other"; /** * @description The applicable per diem rate for this location and expense type * @example 76 */ perDiemRate: number; /** * @description The actual amount spent * @example 62.5 */ actualAmount: number; /** * @description Whether it's more advantageous to claim actual expenses or per diem * @example per_diem * @enum {string} */ optimalClaim: "actual" | "per_diem"; /** * @description The optimal amount to claim (either actual or per diem) * @example 76 */ optimalAmount: number; /** * @description Reference to the per diem rate source * @example GSA Per Diem Rates FY2025 */ perDiemReference: string; /** * @description Additional notes about the per diem analysis * @example First and last travel days are eligible for 75% of the standard per diem rate */ notes: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "per-diem-analysis-bulk": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The transactions to analyze for per diem eligibility */ transactions: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example OFFICE DEPOT #1234 */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 89.99 */ amount: number; /** * @description The category of the transaction * @example office_supplies */ category?: string; }[]; /** * @description The country code for per diem rates (ISO 3166-1 alpha-2) * @example US */ countryCode: string; /** * @description The location where the expenses occurred (city or region) * @example San Francisco, CA */ location: string; /** @description The start and end dates of the business travel */ travelDates: { /** * @description Start date of the business travel * @example 2025-04-20T00:00:00Z */ startDate: string | null; /** * @description End date of the business travel * @example 2025-04-23T00:00:00Z */ endDate: string | null; }; }; }; }; responses: { /** @description Per diem analysis successfully generated for all transactions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description Per diem analysis results for each transaction */ results: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description Whether the transaction is eligible for per diem * @example true */ eligibleForPerDiem: boolean; /** * @description The type of expense * @example meals * @enum {string} */ expenseType: "lodging" | "meals" | "incidental" | "transportation" | "other"; /** * @description The applicable per diem rate for this location and expense type * @example 76 */ perDiemRate: number; /** * @description The actual amount spent * @example 62.5 */ actualAmount: number; /** * @description Whether it's more advantageous to claim actual expenses or per diem * @example per_diem * @enum {string} */ optimalClaim: "actual" | "per_diem"; /** * @description The optimal amount to claim (either actual or per diem) * @example 76 */ optimalAmount: number; /** * @description Reference to the per diem rate source * @example GSA Per Diem Rates FY2025 */ perDiemReference: string; /** * @description Additional notes about the per diem analysis * @example First and last travel days are eligible for 75% of the standard per diem rate */ notes: string; }[]; /** @description Summary of per diem analysis across all transactions */ summary: { /** * @description Total of all actual expenses * @example 1250.75 */ totalActualExpenses: number; /** * @description Total eligible per diem amount * @example 1520 */ totalPerDiemEligible: number; /** * @description Total optimal amount to claim * @example 1520 */ totalOptimalClaim: number; /** * @description Potential additional deduction by claiming optimal amounts * @example 269.25 */ potentialSavings: number; }; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "worker-classification-single": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The payment transaction to analyze for worker classification */ transaction: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example OFFICE DEPOT #1234 */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 89.99 */ amount: number; /** * @description The category of the transaction * @example office_supplies */ category?: string; }; /** @description Optional payment history to the same recipient */ paymentHistory?: { /** * @description Date of the previous payment * @example 2025-03-15T00:00:00Z */ date: string | null; /** * @description Amount of the previous payment * @example 2500 */ amount: number; /** * @description Description of the previous payment * @example Consulting services - March */ description: string; }[]; /** * @description The country code for worker classification rules (ISO 3166-1 alpha-2) * @example US */ countryCode: string; /** * @description Additional context about the working relationship * @example Provides weekly design services but works for multiple clients */ additionalContext?: string; }; }; }; responses: { /** @description Worker classification analysis successfully generated */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description Extracted recipient name from transaction description * @example John Smith Design Services */ recipientName: string; /** * @description Likely classification of the payment recipient * @example contractor * @enum {string} */ classification: "employee" | "contractor" | "uncertain"; /** * @description Confidence in the classification (0-1) * @example 0.85 */ confidence: number; /** @description Analysis of IRS common law factors for classification */ classificationFactors: { /** * @description Assessment of behavioral control factors * @example Limited evidence of behavioral control based on payment patterns */ behavioralControl: string; /** * @description Assessment of financial control factors * @example Payment pattern suggests project-based compensation, not salary */ financialControl: string; /** * @description Assessment of relationship factors * @example Irregular payment schedule suggests non-employee relationship */ relationshipFactors: string; }; /** @description Tax form and filing requirements */ taxRequirements: { /** * @description Tax forms likely required for this worker * @example [ * "1099-NEC", * "W-9" * ] */ forms: string[]; /** * @description Relevant filing deadlines * @example [ * "W-9 before first payment", * "1099-NEC by January 31" * ] */ filingDeadlines: string[]; }; /** * @description Potential risks of misclassification * @example Low risk - payment pattern clearly indicates contractor relationship */ risks: string; /** * @description Recommendations for compliance * @example [ * "Obtain completed W-9", * "Issue 1099-NEC if payments exceed $600 in calendar year" * ] */ recommendations: string[]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "worker-classification-bulk": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description The payment transactions to analyze for worker classification */ transactions: { transaction: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The description of the transaction * @example OFFICE DEPOT #1234 */ description: string; /** * @description The currency of the transaction * @example USD */ currency: string; /** * @description The amount of the transaction * @example 89.99 */ amount: number; /** * @description The category of the transaction * @example office_supplies */ category?: string; }; paymentHistory?: { date: string | null; amount: number; description: string; }[]; additionalContext?: string; }[]; /** * @description The country code for worker classification rules (ISO 3166-1 alpha-2) * @example US */ countryCode: string; }; }; }; responses: { /** @description Worker classification analysis successfully generated for all transactions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** @description Worker classification analysis results for each transaction */ results: { /** * @description The id of the transaction * @example tx_123abc */ id: string; /** * @description Extracted recipient name from transaction description * @example John Smith Design Services */ recipientName: string; /** * @description Likely classification of the payment recipient * @example contractor * @enum {string} */ classification: "employee" | "contractor" | "uncertain"; /** * @description Confidence in the classification (0-1) * @example 0.85 */ confidence: number; /** @description Analysis of IRS common law factors for classification */ classificationFactors: { /** * @description Assessment of behavioral control factors * @example Limited evidence of behavioral control based on payment patterns */ behavioralControl: string; /** * @description Assessment of financial control factors * @example Payment pattern suggests project-based compensation, not salary */ financialControl: string; /** * @description Assessment of relationship factors * @example Irregular payment schedule suggests non-employee relationship */ relationshipFactors: string; }; /** @description Tax form and filing requirements */ taxRequirements: { /** * @description Tax forms likely required for this worker * @example [ * "1099-NEC", * "W-9" * ] */ forms: string[]; /** * @description Relevant filing deadlines * @example [ * "W-9 before first payment", * "1099-NEC by January 31" * ] */ filingDeadlines: string[]; }; /** * @description Potential risks of misclassification * @example Low risk - payment pattern clearly indicates contractor relationship */ risks: string; /** * @description Recommendations for compliance * @example [ * "Obtain completed W-9", * "Issue 1099-NEC if payments exceed $600 in calendar year" * ] */ recommendations: string[]; }[]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "enrichment-analytics": { parameters: { query: { apiId: string; startDate?: string; endDate?: string; enrichmentType?: string; usageType?: string; groupBy?: "day" | "week" | "month"; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Enrichment analytics data */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { analytics: { summary: { /** * @description Total number of enrichment requests * @example 1500 */ totalRequests: number; /** * @description Total number of transactions processed * @example 3200 */ totalTransactions: number; /** * @description Total cost in USD * @example 45.67 */ totalCostUsd: number; /** * @description Cache hit rate (0-1) * @example 0.73 */ cacheHitRate: number; /** * @description Success rate (0-1) * @example 0.98 */ successRate: number; /** * @description Average response time in milliseconds * @example 850 */ avgResponseTimeMs: number; }; breakdown: { /** * @description Type of enrichment usage * @example transaction_enrichment */ usageType: string; /** * @description Specific enrichment type * @example detailed */ enrichmentType: string | null; /** * @description Number of requests for this type * @example 850 */ totalRequests: number; /** * @description Number of transactions for this type * @example 1700 */ totalTransactions: number; /** * @description Cost in USD for this type * @example 25.4 */ totalCostUsd: number; /** * @description Cache hit rate for this type * @example 0.75 */ cacheHitRate: number; /** * @description Success rate for this type * @example 0.99 */ successRate: number; /** * @description Average response time for this type * @example 820 */ avgResponseTimeMs: number; }[]; costAnalysis: { /** * @description Time period * @example 2024-01-15 */ period: string; /** * @description Enrichment type * @example detailed */ enrichmentType: string | null; /** * @description Total cost for this period * @example 12.45 */ totalCostUsd: number; /** * @description Total requests for this period * @example 320 */ totalRequests: number; /** * @description Total transactions for this period * @example 650 */ totalTransactions: number; /** * @description Average cost per request * @example 0.039 */ avgCostPerRequestUsd: number; }[]; }; _meta: { period: { /** * Format: date-time * @description Analytics period start * @example 2024-01-01T00:00:00Z */ start: string; /** * Format: date-time * @description Analytics period end * @example 2024-01-31T23:59:59Z */ end: string; }; /** * Format: date-time * @description When the analytics were generated * @example 2024-01-31T15:30:00Z */ generatedAt: string; /** * @description Request identifier * @example req_1234567890 */ requestId: string; }; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description Too many requests */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": unknown; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; triggerAsyncEnrichment: { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description Array of transactions to enrich (max 25) */ transactions: { /** * @description The unique identifier for the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The transaction description from the bank/payment provider * @example AMAZON.COM*XY1234AB Seattle WA */ description: string; /** * @description The currency code (ISO 4217) * @example USD */ currency: string; /** * @description The transaction amount (positive for income, negative for expenses) * @example -49.99 */ amount: number; /** * @description Optional existing category if already classified * @example shopping */ category?: string; /** * @description Optional merchant name if already identified * @example Amazon */ merchantName?: string; }[]; /** * @description Types of enrichment to perform on the transactions * @example [ * "category", * "merchant", * "website" * ] */ enrichmentTypes: ("category" | "merchant" | "website" | "subscription_detection" | "business_purpose" | "tax_category" | "receipt_requirement" | "per_diem_eligibility")[]; /** @description Optional job configuration */ options?: { /** * @description Job priority level * @default normal * @example normal * @enum {string} */ priority?: "low" | "normal" | "high"; /** * Format: uri * @description Optional webhook URL to notify when job completes * @example https://your-app.com/webhooks/enrichment */ webhookUrl?: string; /** * @description Number of transactions to process in each batch * @default 10 * @example 10 */ batchSize?: number; /** * @description Include confidence scores in results * @default true * @example true */ includeConfidence?: boolean; }; }; }; }; responses: { /** @description Enrichment job created successfully */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description Unique job identifier for tracking progress * @example job_enrichment_abc123def456 */ jobId: string; /** * @description Initial job status * @example queued * @enum {string} */ status: "queued"; /** * @description Total number of transactions to process * @example 15 */ totalTransactions: number; /** * @description Estimated completion time (ISO 8601) * @example 2025-01-21T10:35:00Z */ estimatedCompletion: string; /** * Format: uri * @description URL to poll for job status updates * @example https://api.solomon-ai.app/v1/financials/enrich/status/job_enrichment_abc123def456 */ statusUrl: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; triggerAsyncCategorization: { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": { /** @description Array of transactions to categorize (max 25) */ transactions: { /** * @description The unique identifier for the transaction * @example tx_123abc */ id: string; /** * @description The date of the transaction * @example 2025-04-23T10:30:00Z */ date: string | null; /** * @description The transaction description from the bank/payment provider * @example AMAZON.COM*XY1234AB Seattle WA */ description: string; /** * @description The currency code (ISO 4217) * @example USD */ currency: string; /** * @description The transaction amount (positive for income, negative for expenses) * @example -49.99 */ amount: number; /** * @description Optional existing category if already classified * @example shopping */ category?: string; /** * @description Optional merchant name if already identified * @example Amazon */ merchantName?: string; }[]; /** @description Optional job configuration */ options?: { /** * @description Job priority level * @default normal * @example normal * @enum {string} */ priority?: "low" | "normal" | "high"; /** * Format: uri * @description Optional webhook URL to notify when job completes * @example https://your-app.com/webhooks/categorization */ webhookUrl?: string; /** * @description Number of transactions to process in each batch * @default 15 * @example 15 */ batchSize?: number; /** * @description Include subcategory predictions * @default false * @example false */ includeSubcategories?: boolean; /** * @description Minimum confidence threshold for category predictions * @default 0.7 * @example 0.7 */ confidenceThreshold?: number; }; }; }; }; responses: { /** @description Categorization job created successfully */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description Unique job identifier for tracking progress * @example job_categorization_xyz789abc123 */ jobId: string; /** * @description Initial job status * @example queued * @enum {string} */ status: "queued"; /** * @description Total number of transactions to categorize * @example 20 */ totalTransactions: number; /** * @description Estimated completion time (ISO 8601) * @example 2025-01-21T10:33:00Z */ estimatedCompletion: string; /** * Format: uri * @description URL to poll for job status updates * @example https://api.solomon-ai.app/v1/financials/categorize/status/job_categorization_xyz789abc123 */ statusUrl: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; getCategorizationJobStatus: { parameters: { query: { apiId: string; }; header?: never; path: { jobId: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Job status retrieved successfully */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The job identifier * @example job_enrichment_abc123def456 */ jobId: string; /** * @description Current job status * @example processing * @enum {string} */ status: "queued" | "processing" | "completed" | "failed" | "cancelled"; /** @description Job progress information */ progress: { /** * @description Total number of transactions * @example 15 */ total: number; /** * @description Number of transactions completed * @example 8 */ completed: number; /** * @description Number of transactions that failed processing * @example 0 */ failed: number; /** * @description Completion percentage * @example 53.33 */ percentage: number; }; /** * @description When the job started processing (ISO 8601) * @example 2025-01-21T10:30:15Z */ startedAt?: string; /** * @description When the job completed (ISO 8601) * @example 2025-01-21T10:32:45Z */ completedAt?: string; /** * @description Error message if job failed * @example AI service temporarily unavailable */ error?: string; /** @description Job results (only present when status is 'completed') */ results?: unknown; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; getEnrichmentJobStatus: { parameters: { query: { apiId: string; }; header?: never; path: { jobId: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Job status retrieved successfully */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description The job identifier * @example job_enrichment_abc123def456 */ jobId: string; /** * @description Current job status * @example processing * @enum {string} */ status: "queued" | "processing" | "completed" | "failed" | "cancelled"; /** @description Job progress information */ progress: { /** * @description Total number of transactions * @example 15 */ total: number; /** * @description Number of transactions completed * @example 8 */ completed: number; /** * @description Number of transactions that failed processing * @example 0 */ failed: number; /** * @description Completion percentage * @example 53.33 */ percentage: number; }; /** * @description When the job started processing (ISO 8601) * @example 2025-01-21T10:30:15Z */ startedAt?: string; /** * @description When the job completed (ISO 8601) * @example 2025-01-21T10:32:45Z */ completedAt?: string; /** * @description Error message if job failed * @example AI service temporarily unavailable */ error?: string; /** @description Job results (only present when status is 'completed') */ results?: unknown; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "get.health": { parameters: { query: { apiId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Retrieve health */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["HealthSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "get.institutions": { parameters: { query: { apiId: string; connectionId?: string; q?: string; limit?: string; countryCode: "AT" | "BE" | "BG" | "HR" | "CY" | "CZ" | "DK" | "EE" | "FI" | "FR" | "DE" | "GR" | "HU" | "IS" | "IE" | "IT" | "LV" | "LI" | "LT" | "LU" | "MT" | "NL" | "NO" | "PL" | "PT" | "RO" | "SK" | "SI" | "ES" | "SE" | "GB" | "US"; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Retrieve institutions */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["InstitutionsSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "update.institutions.usage": { parameters: { query: { apiId: string; usageType?: "connection_created" | "connection_deleted" | "transaction_fetch" | "account_fetch" | "statement_access" | "balance_check" | "auth_refresh" | "transaction_enrichment" | "category_prediction" | "tax_analysis" | "business_purpose" | "receipt_requirement" | "per_diem_analysis" | "worker_classification" | "multi_model_enrichment"; connectionId?: string; transactionCount?: number | null; enrichmentType?: string; cached?: boolean | null; costUsd?: number | null; modelUsed?: string; responseTimeMs?: number | null; provider?: "plaid" | "gocardless" | "enablebanking" | "teller" | "stripe"; }; header?: never; path: { id: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Update institution usage */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["UpdateUsageSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "get.rates": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Retrieve rates */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["RatesSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "get.statements": { parameters: { query: { apiId: string; connectionId?: string; provider?: "teller" | "plaid" | "gocardless" | "stripe" | "enablebanking"; accessToken?: string; accountId: string; userId: string; teamId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Retrieve statements */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { data: { account_id: string; statement_id: string; month: string; year: string; }[]; connection?: components["schemas"]["ConnectionInfoSchema"]; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "get.statements.pdf": { parameters: { query: { apiId: string; provider: "teller" | "plaid" | "gocardless" | "stripe" | "enablebanking"; accessToken: string; statementId: string; accountId: string; userId: string; teamId: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description Retrieve statement PDF */ 200: { headers: { [name: string]: unknown; }; content: { "application/pdf": unknown; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "post.gocardless.link": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["GoCardLessLinkBodySchema"] & { apiId: string; }; }; }; responses: { /** @description Retrieve Link */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["GoCardLessLinkSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "post.gocardless.agreement": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["GoCardLessAgreementBodySchema"] & { apiId: string; }; }; }; responses: { /** @description Retrieve Agreement */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["GoCardLessAgreementSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "post.gocardless.exchange": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["GoCardLessExchangeBodySchema"] & { apiId: string; }; }; }; responses: { /** @description Retrieve Exchange */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["GoCardLessExchangeSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "post.plaid.link": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["PlaidLinkBodySchema"] & { apiId: string; }; }; }; responses: { /** @description Retrieve Link */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["PlaidLinkSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "post.plaid.exchange": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["PlaidExchangeBodySchema"] & { apiId: string; institutionName?: string; connectionName?: string; }; }; }; responses: { /** @description Retrieve Exchange */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["PlaidExchangeSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "post.enablebanking.link": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["EnableBankingLinkBodySchema"] & { apiId: string; }; }; }; responses: { /** @description Retrieve Link */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["EnableBankingLinkResponseSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "post.enablebanking.exchange": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["EnableBankingExchangeBodySchema"] & { apiId: string; }; }; }; responses: { /** @description Retrieve Session */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["EnableBankingExchangeSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "v1.auth.stripe.connect.authorize": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["StripeConnectAuthBodySchema"]; }; }; responses: { /** @description Stripe Connect authorization URL generated successfully */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["StripeConnectAuthResponseSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "v1.auth.stripe.connect.exchange": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: { content: { "application/json": components["schemas"]["StripeConnectExchangeBodySchema"]; }; }; responses: { /** @description Stripe Connect tokens exchanged successfully */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["StripeConnectExchangeResponseSchema"]; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "v1.webhooks.stripe": { parameters: { query?: never; header: { "stripe-signature": string; }; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { id: string; /** @enum {string} */ object: "event"; type: string; data: { object?: unknown; }; created: number; livemode: boolean; pending_webhooks: number; request: { id: string | null; idempotency_key: string | null; } | null; }; }; }; responses: { /** @description Webhook processed successfully */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { received: boolean; processed: boolean; workflowId?: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "v1.webhooks.stripe.sync": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { accountId: string; /** * @default webhook * @enum {string} */ syncType?: "full" | "incremental" | "webhook"; workspaceId?: string; }; }; }; responses: { /** @description Sync workflow triggered successfully */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { success: boolean; workflowId: string; accountId: string; syncType: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "v1.webhooks.plaid": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { webhook_type: string; webhook_code: string; item_id: string; error?: unknown; new_transactions?: number; removed_transactions?: string[]; consent_expiration_time?: string | null; historical_update_complete?: boolean; /** @enum {string} */ environment: "production" | "development" | "sandbox"; }; }; }; responses: { /** @description Webhook processed successfully */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { received: boolean; processed: boolean; workflowId?: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; "v1.webhooks.plaid.sync": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { itemId: string; accessToken: string; /** * @default webhook * @enum {string} */ syncType?: "full" | "incremental" | "webhook" | "historical_update"; workspaceId?: string; institutionId?: string; webhookCode?: string; }; }; }; responses: { /** @description Sync workflow triggered successfully */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { success: boolean; workflowId: string; itemId: string; syncType: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; provisionBucket: { parameters: { query?: never; header?: never; path: { orgId: string; }; cookie?: never; }; requestBody?: never; responses: { /** @description Bucket already exists for organization */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description Name of the provisioned R2 bucket * @example org-123456789-production */ bucketName: string; /** * @description Unique identifier for the bucket * @example bucket_abc123xyz */ bucketId: string; /** * @description ISO timestamp when the bucket was created * @example 2024-01-01T00:00:00.000Z */ createdAt: string; /** * @description ID of the scoped API token for this bucket * @example token_def456ghi */ accessTokenId: string; }; }; }; /** @description Bucket provisioned successfully */ 201: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * @description Name of the provisioned R2 bucket * @example org-123456789-production */ bucketName: string; /** * @description Unique identifier for the bucket * @example bucket_abc123xyz */ bucketId: string; /** * @description ISO timestamp when the bucket was created * @example 2024-01-01T00:00:00.000Z */ createdAt: string; /** * @description ID of the scoped API token for this bucket * @example token_def456ghi */ accessTokenId: string; }; }; }; /** @description The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). */ 400: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrBadRequest"]; }; }; /** @description Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. */ 401: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrUnauthorized"]; }; }; /** @description The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server. */ 403: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrForbidden"]; }; }; /** @description The server cannot find the requested resource. In the browser, this means the URL is not recognized. In an API, this can also mean that the endpoint is valid but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorized client. This response code is probably the most well known due to its frequent occurrence on the web. */ 404: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrNotFound"]; }; }; /** @description This response is sent when a request conflicts with the current state of the server. */ 409: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrConflict"]; }; }; /** @description The requested operation cannot be completed because certain conditions were not met. This typically occurs when a required resource state or version check fails. */ 412: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrPreconditionFailed"]; }; }; /** @description The user has sent too many requests in a given amount of time ("rate limiting") */ 429: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrTooManyRequests"]; }; }; /** @description The server has encountered a situation it does not know how to handle. */ 500: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["ErrInternalServerError"]; }; }; }; }; } type ErrorResponse = paths["/v1/liveness"]["get"]["responses"]["400"]["content"]["application/json"] | paths["/v1/liveness"]["get"]["responses"]["401"]["content"]["application/json"] | paths["/v1/liveness"]["get"]["responses"]["403"]["content"]["application/json"] | paths["/v1/liveness"]["get"]["responses"]["404"]["content"]["application/json"] | paths["/v1/liveness"]["get"]["responses"]["409"]["content"]["application/json"] | paths["/v1/liveness"]["get"]["responses"]["429"]["content"]["application/json"] | paths["/v1/liveness"]["get"]["responses"]["500"]["content"]["application/json"]; /** * @fileoverview Fluent Interface Builders for Financial Workspace Backend Client * * This module provides strongly-typed builder patterns for creating API requests * with improved developer experience, type safety, and method chaining capabilities. * * @author Solomon AI Engineering Team * @version 1.0.0 */ /** * Builder interface for creating API keys with fluent method chaining. * * @template TPermissions - Union type of permission strings for type safety */ declare class KeyBuilder { private client; private request; constructor(client: FinancialWorkspaceBackendClient); /** * Sets the API ID for the key. * * @param apiId - The API identifier * @returns The builder instance for method chaining * * @example * ```typescript * const builder = client.keys.builder() * .forApi('api_123456'); * ``` */ forApi(apiId: string): this; /** * Sets a human-readable name for the key. * * @param name - The key name * @returns The builder instance for method chaining * * @example * ```typescript * const builder = client.keys.builder() * .withName('Production API Key'); * ``` */ withName(name: string): this; /** * Sets a prefix for the generated key. * * @param prefix - The key prefix * @returns The builder instance for method chaining * * @example * ```typescript * const builder = client.keys.builder() * .withPrefix('prod_sk'); * ``` */ withPrefix(prefix: string): this; /** * Adds metadata to the key. * * @param meta - Key-value pairs for metadata * @returns The builder instance for method chaining * * @example * ```typescript * const builder = client.keys.builder() * .withMetadata({ * environment: 'production', * team: 'backend', * version: '2.0' * }); * ``` */ withMetadata(meta: Record): this; /** * Sets permissions for the key with type safety. * * @param permissions - Array of permission strings * @returns The builder instance for method chaining with updated type * * @example * ```typescript * const builder = client.keys.builder() * .withPermissions(['read:users', 'write:posts', 'admin:system']); * ``` */ withPermissions

(permissions: P[]): KeyBuilder

; /** * Adds a single permission to the existing permission set. * * @param permission - Permission string to add * @returns The builder instance for method chaining * * @example * ```typescript * const builder = client.keys.builder() * .withPermissions(['read:users']) * .addPermission('write:posts'); * ``` */ addPermission

(permission: P): KeyBuilder; /** * Sets roles for the key. * * @param roles - Array of role names * @returns The builder instance for method chaining * * @example * ```typescript * const builder = client.keys.builder() * .withRoles(['admin', 'user-manager']); * ``` */ withRoles(roles: string[]): this; /** * Sets an expiration timestamp for the key. * * @param expiresAt - Unix timestamp in milliseconds * @returns The builder instance for method chaining * * @example * ```typescript * const builder = client.keys.builder() * .withExpiration(Date.now() + 86400000); // 24 hours * ``` */ withExpiration(expiresAt: number): this; /** * Sets an expiration using a Date object. * * @param date - Expiration date * @returns The builder instance for method chaining * * @example * ```typescript * const builder = client.keys.builder() * .expiresAt(new Date('2024-12-31')); * ``` */ expiresAt(date: Date): this; /** * Sets the remaining usage count for the key. * * @param remaining - Number of allowed uses * @returns The builder instance for method chaining * * @example * ```typescript * const builder = client.keys.builder() * .withRemainingUses(1000); * ``` */ withRemainingUses(remaining: number): this; /** * Sets rate limiting configuration for the key. * * @param config - Rate limit configuration * @returns The builder instance for method chaining * * @example * ```typescript * const builder = client.keys.builder() * .withRateLimit({ * type: 'fast', * limit: 100, * refillRate: 10, * refillInterval: 60000 * }); * ``` */ withRateLimit(config: NonNullable): this; /** * Sets the key as enabled or disabled. * * @param enabled - Whether the key should be enabled * @returns The builder instance for method chaining * * @example * ```typescript * const builder = client.keys.builder() * .enabled(false); // Create disabled key * ``` */ enabled(enabled?: boolean): this; /** * Sets external ID for the key (for integration with external systems). * * @param externalId - External identifier * @returns The builder instance for method chaining * * @example * ```typescript * const builder = client.keys.builder() * .withExternalId('ext_user_123'); * ``` */ withExternalId(externalId: string): this; /** * Gets the current request configuration. * * @returns The built request object */ build(): Partial; /** * Validates the current configuration. * * @returns Validation result with errors if any * * @example * ```typescript * const validation = builder.validate(); * if (!validation.valid) { * console.error('Validation errors:', validation.errors); * } * ``` */ validate(): { valid: boolean; errors: string[]; }; /** * Creates the API key using the configured parameters. * * @returns Promise resolving to the created key * * @example * ```typescript * const result = await client.keys.builder() * .forApi('api_123') * .withName('My API Key') * .withPermissions(['read:users']) * .create(); * * if (!result.error) { * console.log('Created key:', result.result.key); * } * ``` */ create(): Promise<{ error: { code: "VALIDATION_ERROR"; message: string; docs: string; requestId: string; }; } | Awaited>>; } /** * Builder for creating key verification requests with type safety. * * @template TPermissions - Union type of permission strings for type safety */ declare class KeyVerificationBuilder { private client; private request; constructor(client: FinancialWorkspaceBackendClient, key: string); /** * Adds permission requirements using AND logic. * * @param permissions - Array of required permissions * @returns The builder instance for method chaining * * @example * ```typescript * const result = await client.keys.verify('sk_123') * .requireAllPermissions(['read:users', 'write:posts']); * ``` */ requireAllPermissions

(permissions: P[]): KeyVerificationBuilder

; /** * Adds permission requirements using OR logic. * * @param permissions - Array of alternative permissions * @returns The builder instance for method chaining * * @example * ```typescript * const result = await client.keys.verify('sk_123') * .requireAnyPermission(['admin:system', 'read:users']); * ``` */ requireAnyPermission

(permissions: P[]): KeyVerificationBuilder

; /** * Adds complex permission requirements with nested logic. * * @param query - Complex permission query * @returns The builder instance for method chaining * * @example * ```typescript * const result = await client.keys.verify('sk_123') * .withPermissionQuery({ * or: [ * { and: ['admin:system'] }, * { and: ['read:users', 'write:users'] } * ] * }); * ``` */ withPermissionQuery

(query: PermissionQuery

): KeyVerificationBuilder

; /** * Executes the key verification. * * @returns Promise resolving to verification result */ execute(): Promise>>; } /** * Builder for creating API configurations. */ declare class ApiBuilder { private client; private request; constructor(client: FinancialWorkspaceBackendClient); /** * Sets the API name. * * @param name - The API name * @returns The builder instance for method chaining */ withName(name: string): this; /** * Validates the API configuration. * * @returns Validation result */ validate(): { valid: boolean; errors: string[]; }; /** * Sets the workspace for the API. * * @param workspaceId - The workspace identifier * @returns The builder instance for method chaining */ inWorkspace(workspaceId: string): this; /** * Creates the API using the configured parameters. * * @returns Promise resolving to the created API */ create(): Promise<{ error: { code: "VALIDATION_ERROR"; message: string; docs: string; requestId: string; }; } | Awaited>>; } /** * Builder for creating permission configurations. */ declare class PermissionBuilder { private client; private request; constructor(client: FinancialWorkspaceBackendClient); /** * Sets the permission name. * * @param name - The permission name * @returns The builder instance for method chaining */ withName(name: string): this; /** * Sets the permission description. * * @param description - The permission description * @returns The builder instance for method chaining */ withDescription(description: string): this; /** * Creates the permission using the configured parameters. * * @returns Promise resolving to the created permission */ create(): Promise<{ error: { code: "VALIDATION_ERROR"; message: string; docs: string; requestId: string; }; } | Awaited>>; } /** * Builder for creating role configurations. */ declare class RoleBuilder { private client; private request; constructor(client: FinancialWorkspaceBackendClient); /** * Sets the role name. * * @param name - The role name * @returns The builder instance for method chaining */ withName(name: string): this; /** * Sets the role description. * * @param description - The role description * @returns The builder instance for method chaining */ withDescription(description: string): this; /** * Sets permissions for the role. * * @param permissions - Array of permission names * @returns The builder instance for method chaining */ withPermissions(permissions: string[]): this; /** * Adds a single permission to the existing permission set. * * @param permission - Permission name to add * @returns The builder instance for method chaining */ addPermission(permission: string): this; /** * Creates the role using the configured parameters. * * @returns Promise resolving to the created role */ create(): Promise<{ error: { code: "VALIDATION_ERROR"; message: string; docs: string; requestId: string; }; } | Awaited>>; } /** * @fileoverview Middleware & Plugin System for Financial Workspace Backend Client * * This module provides a comprehensive middleware and plugin architecture that allows * developers to extend the client with custom functionality, request/response transformations, * monitoring, security, and more. * * @author Solomon AI Engineering Team * @version 1.0.0 */ /** * Generic API request type that represents any request to the Financial Workspace Backend */ type ApiRequest = { /** Array of path segments that will be joined to form the API endpoint URL */ path: string[]; /** HTTP method for the request */ method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH"; /** Request headers */ headers?: Record; /** Query parameters */ query?: Record; /** Request body */ body?: unknown; /** Additional metadata */ metadata?: Record; }; /** * Generic API response type */ type ApiResponse = { /** Response data */ data?: T; /** Error information if request failed */ error?: { code: string; message: string; docs?: string; requestId?: string; }; /** Response headers */ headers?: Record; /** HTTP status code */ status?: number; /** Request metadata */ metadata?: Record; }; /** * Context object passed through the middleware pipeline */ interface MiddlewareContext { /** Unique identifier for this request */ requestId: string; /** Timestamp when request started */ startTime: number; /** User-defined context data */ userData?: Record; /** Middleware-specific data */ middlewareData?: Record; } /** * Core middleware interface for request/response transformation */ interface Middleware { /** Middleware name for identification and debugging */ name: string; /** * Called before the request is sent to the API * @param request - The outgoing API request * @param context - Request context * @returns Modified request or Promise resolving to modified request */ before?: (request: ApiRequest, context: MiddlewareContext) => Promise | ApiRequest; /** * Called after receiving a successful response from the API * @param response - The API response * @param request - The original request * @param context - Request context * @returns Modified response or Promise resolving to modified response */ after?: (response: ApiResponse, request: ApiRequest, context: MiddlewareContext) => Promise | ApiResponse; /** * Called when an error occurs during the request * @param error - The error that occurred * @param request - The original request * @param context - Request context * @returns Promise that resolves when error handling is complete */ onError?: (error: Error, request: ApiRequest, context: MiddlewareContext) => Promise | void; /** * Called when the middleware is enabled/disabled * @param enabled - Whether the middleware is being enabled or disabled */ onToggle?: (enabled: boolean) => Promise | void; } /** * Plugin interface for extending client functionality */ interface Plugin { /** Plugin name for identification */ name: string; /** Plugin version */ version: string; /** Plugin description */ description?: string; /** Dependencies on other plugins */ dependencies?: string[]; /** * Initialize the plugin with the client instance * @param client - The client instance * @param options - Plugin-specific configuration options */ initialize: (client: unknown, options?: Record) => Promise | void; /** * Cleanup when plugin is disabled or client is destroyed */ destroy?: () => Promise | void; /** * Get middleware provided by this plugin */ getMiddleware?: () => Middleware[]; /** * Get additional methods/properties to add to the client */ getClientExtensions?: () => Record; } /** * @fileoverview Type definitions for Financial Workspace Backend Client SDK * * This file contains all the return type definitions extracted from the client methods * to provide better type safety and reusability across the codebase. */ /** * Standard result type for all API operations. * This is a discriminated union that represents either a successful result or an error. */ type Result$1 = { result: T; error?: never; } | { result?: never; error: { code: ErrorResponse["error"]["code"]; message: ErrorResponse["error"]["message"]; docs: ErrorResponse["error"]["docs"]; requestId: string; }; }; type LivenessCheckResult = Result$1; type KeyCreateResult = Result$1; type KeyWhoamiResult = Result$1; type KeyAddPermissionsResult = Result$1; type KeySetPermissionsResult = Result$1; type KeyRemovePermissionsResult = Result$1; type KeyAddRolesResult = Result$1; type KeyRemoveRolesResult = Result$1; type KeySetRolesResult = Result$1; type KeyUpdateResult = Result$1; type KeyVerifyResult = Result$1; type KeyDeleteResult = Result$1; type KeyUpdateRemainingResult = Result$1; type KeyGetResult = Result$1; type KeyGetVerificationsResult = Result$1; type ApiCreateResult = Result$1; type ApiDeleteResult = Result$1; type ApiDeleteKeysResult = Result$1; type ApiGetResult = Result$1; type ApiListKeysResult = Result$1; type RoleCreateResult = Result$1; type RoleGetResult = Result$1; type RoleListResult = Result$1; type RoleDeleteResult = Result$1; type PermissionCreateResult = Result$1; type PermissionGetResult = Result$1; type PermissionListResult = Result$1; type PermissionDeleteResult = Result$1; type RateLimitResult = Result$1; type RateLimitGetOverrideResult = Result$1; type RateLimitListOverridesResult = Result$1; type RateLimitSetOverrideResult = Result$1; type RateLimitDeleteOverrideResult = Result$1; type IdentityCreateResult = Result$1; type IdentityGetResult = Result$1; type IdentityListResult = Result$1; type IdentityDeleteResult = Result$1; type IdentityUpdateResult = Result$1; type AnalyticsGetVerificationsResult = Result$1; type MigrationCreateKeysResult = Result$1; type MigrationEnqueueKeysResult = Result$1; type ConnectionStatusResult = Result$1; type ConnectionDeleteResult = Result$1; type ConnectionGoCardlessResult = Result$1; type ConnectionGetResult = Result$1; type ConnectionAccountsResult = Result$1; type ConnectionAccountBalanceResult = Result$1; type TransactionsResult = Result$1; type RecurringTransactionsResult = Result$1; type HealthResult = Result$1; type InstitutionsResult = Result$1; type InstitutionUsageResult = Result$1; type RatesResult = Result$1; type StatementsResult = Result$1; type StatementsPdfResult = Result$1; type GoCardlessLinkResult = Result$1; type GoCardlessAgreementResult = Result$1; type GoCardlessExchangeResult = Result$1; type PlaidLinkResult = Result$1; type PlaidExchangeResult = Result$1; type EnableBankingLinkResult = Result$1; type EnableBankingExchangeResult = Result$1; type LegacyKeyCreateResult = Result$1; type LegacyKeyVerifyResult = Result$1; type LegacyKeyListResult = Result$1; type AiEnrichResult = Result$1; type AiDetailedEnrichmentResult = Result$1; type AiCategorizeResult = Result$1; type AiMultiModelResult = Result$1; type AiTaxCategorySingleResult = Result$1; type AiTaxCategoryBulkResult = Result$1; type AiBusinessPurposeSingleResult = Result$1; type AiBusinessPurposeBulkResult = Result$1; type AiReceiptRequirementSingleResult = Result$1; type AiReceiptRequirementBulkResult = Result$1; type AiTaxDeductionSingleResult = Result$1; type AiTaxDeductionBulkResult = Result$1; type AiPerDiemSingleResult = Result$1; type AiPerDiemBulkResult = Result$1; type AiWorkerClassificationSingleResult = Result$1; type AiWorkerClassificationBulkResult = Result$1; type AiAnalyticsResult = Result$1; type CreateKeyResult = Result$1<{ keyId: string; key: string; }>; type Key = ExtractData; type Api = ExtractData; type Permission = ExtractData; type Role = ExtractData; type Identity = ExtractData; type Transaction = operations["get.transactions"]["responses"]["200"]["content"]["application/json"]["data"][0]; type RecurringTransaction = operations["get.transactions.recurring"]["responses"]["200"]["content"]["application/json"]["inflow"][0] | operations["get.transactions.recurring"]["responses"]["200"]["content"]["application/json"]["outflow"][0]; type Institution = operations["get.institutions"]["responses"]["200"]["content"]["application/json"]["data"][0]; type Connection = operations["get.connections.by.reference"]["responses"]["200"]["content"]["application/json"]["data"]; type Account = operations["get.connections.accounts"]["responses"]["200"]["content"]["application/json"]["data"][0]; type AccountBalance = operations["get.connections.account.balance"]["responses"]["200"]["content"]["application/json"]["data"]; type Rate = operations["get.rates"]["responses"]["200"]["content"]["application/json"]["data"][0]; type Statement = operations["get.statements"]["responses"]["200"]["content"]["application/json"]["data"][0]; type HealthCheck = operations["get.health"]["responses"]["200"]["content"]["application/json"]["data"]; type EnrichmentResult = operations["enrich-transactions"]["responses"]["200"]["content"]["application/json"]["data"]; type DetailedEnrichmentResult = operations["detailed-enrichment"]["responses"]["200"]["content"]["application/json"]; type CategoryPredictionResult = operations["category-prediction"]["responses"]["200"]["content"]["application/json"]; type MultiModelEnrichmentResult = operations["multi-model-enrichment"]["responses"]["200"]["content"]["application/json"]; type TaxCategoryResult = operations["tax-category-single"]["responses"]["200"]["content"]["application/json"]; type BusinessPurposeResult = operations["business-purpose-single"]["responses"]["200"]["content"]["application/json"]; type ReceiptRequirementResult = operations["receipt-requirement-single"]["responses"]["200"]["content"]["application/json"]; type TaxDeductionResult = operations["tax-deduction-single"]["responses"]["200"]["content"]["application/json"]; type PerDiemResult = operations["per-diem-analysis-single"]["responses"]["200"]["content"]["application/json"]; type WorkerClassificationResult = operations["worker-classification-single"]["responses"]["200"]["content"]["application/json"]; type GoCardlessLinkData = operations["post.gocardless.link"]["responses"]["200"]["content"]["application/json"]["data"]; type GoCardlessAgreementData = operations["post.gocardless.agreement"]["responses"]["200"]["content"]["application/json"]["data"]; type PlaidLinkData = operations["post.plaid.link"]["responses"]["200"]["content"]["application/json"]["data"]; type PlaidExchangeData = operations["post.plaid.exchange"]["responses"]["200"]["content"]["application/json"]["data"]; type TransactionSchema = components["schemas"]["TransactionSchema"]; type InstitutionSchema = components["schemas"]["InstitutionSchema"]; type ConnectionInfoSchema = components["schemas"]["ConnectionInfoSchema"]; type HealthCheckResponse = components["schemas"]["HealthCheckResponse"]; type RecurringTransactionInflow = operations["get.transactions.recurring"]["responses"]["200"]["content"]["application/json"]["inflow"][0]; type RecurringTransactionOutflow = operations["get.transactions.recurring"]["responses"]["200"]["content"]["application/json"]["outflow"][0]; /** * Extract the success data type from a Result type * @example * type KeyData = ExtractData; // Gets the data type from a successful key creation */ type ExtractData = T extends Result$1 ? R : never; /** * Extract the error type from a Result type * @example * type KeyError = ExtractError; // Gets the error type from a failed key creation */ type ExtractError = T extends { error: infer E; } ? E : never; /** * @fileoverview Financial Workspace Backend Client SDK * * This module provides a comprehensive TypeScript SDK for interacting with the Financial Workspace Backend API. * It includes support for AI-powered transaction analysis, banking integrations, key management, permissions, * rate limiting, and more. * * @author Solomon AI Engineering Team * @version 2.0.0 * @since 1.0.0 */ /** * Configuration options for the Financial Workspace Backend Client. * * @public * @interface ClientOptions * * @example * ```typescript * const client = new FinancialWorkspaceBackendClient({ * rootKey: 'fwb_1234567890abcdef', * baseUrl: 'https://api.solomon-ai.app', * retry: { * attempts: 3, * backoff: (count) => Math.pow(2, count) * 1000 * } * }); * ``` */ type ClientOptions = ({ /** @deprecated Use rootKey instead */ token?: never; /** * The root API key from the Financial Workspace Backend platform. * * This is the primary authentication method for accessing the API. * Root keys provide full access to all API endpoints and should be * kept secure and never exposed in client-side code. * * You can create and manage your root keys here: * https://financial-workspace-backend.solomon-ai.app/app/settings/root-keys * * @example "fwb_1234567890abcdef1234567890abcdef" */ rootKey: string; } | { /** * Legacy workspace key from the Financial Workspace Backend platform. * * @deprecated Use `rootKey` instead for enhanced security and features. * This field will be removed in a future version. * * @example "fwb_legacy_1234567890abcdef" */ token: string; /** @deprecated Use rootKey instead */ rootKey?: never; }) & { /** * The base URL for the Financial Workspace Backend API. * * This should point to your deployment of the Financial Workspace Backend. * For production use, this typically points to your hosted instance. * For development, you might use a local or staging environment. * * @default "https://fwb-engine.solomon-ai.app" * @example "https://api.solomon-ai.app" * @example "https://staging-api.solomon-ai.app" * @example "http://localhost:3000" */ baseUrl?: string; /** * Default API ID for operations that require it. * * When set, this API ID will be automatically used for all operations * that require an apiId parameter, eliminating the need to pass it * repeatedly. This significantly improves developer experience. * * You can still override this on a per-request basis by passing * a different apiId in the request parameters. * * @example "api_1234567890abcdef" * @since 2.0.0 */ apiId?: string; /** * Controls whether telemetry data is collected and sent. * * When enabled (default), the SDK collects anonymous usage statistics * to help improve the service. This includes: * - Runtime environment (Node.js version, browser info) * - Platform information (Vercel, AWS Lambda, etc.) * - SDK version and wrapper SDK versions * - Request patterns and error rates * * No sensitive data (API keys, request bodies, responses) is ever collected. * * @default false * @example true // Disable telemetry for enhanced privacy */ disableTelemetry?: boolean; /** * Configuration for automatic retry behavior on network errors and server issues. * * The SDK will automatically retry failed requests with exponential backoff * for transient errors (network issues, 5xx server errors, timeouts). * Client errors (4xx) are not retried as they indicate permanent failures. * * @example * ```typescript * { * attempts: 3, * backoff: (retryCount) => Math.min(1000 * Math.pow(2, retryCount), 30000) * } * ``` */ retry?: { /** * Maximum number of retry attempts for failed requests. * * The total number of requests made will be `attempts + 1` (initial attempt + retries). * Set to `0` to disable retries entirely. * * @default 5 * @minimum 0 * @maximum 10 * @example 3 // Will make up to 4 total requests (1 initial + 3 retries) */ attempts?: number; /** * Function that determines the delay before the next retry attempt. * * This function receives the current retry count (0-indexed) and should * return the number of milliseconds to wait before the next attempt. * * The default implementation uses exponential backoff with jitter: * `Math.round(Math.exp(retryCount) * 10)` * * @param retryCount - The current retry attempt (0 for first retry, 1 for second, etc.) * @returns The number of milliseconds to wait before the next retry * * @default `(retryCount) => Math.round(Math.exp(retryCount) * 10)` * * @example * ```typescript * // Linear backoff: 1s, 2s, 3s, ... * (retryCount) => (retryCount + 1) * 1000 * * // Exponential backoff with cap: 1s, 2s, 4s, 8s, 16s (max 30s) * (retryCount) => Math.min(1000 * Math.pow(2, retryCount), 30000) * * // Fixed delay: always wait 5 seconds * () => 5000 * ``` */ backoff?: (retryCount: number) => number; }; /** * Custom fetch cache behavior for HTTP requests. * * This controls how the underlying fetch requests are cached by the browser * or runtime environment. This follows the standard Fetch API cache options. * * @see https://developer.mozilla.org/en-US/docs/Web/API/Request/cache * * @example "no-cache" // Always fetch from server, bypassing cache * @example "force-cache" // Use cached response if available * @example "only-if-cached" // Only use cached responses */ cache?: RequestCache; /** * Version identifier for SDK wrappers and integrations. * * This field is used internally for telemetry and debugging purposes * to track which wrapper SDKs or integration libraries are being used. * * Only set this if you're building a wrapper around this SDK. * End users should leave this undefined. * * @internal * @example "next-auth-adapter@1.2.3" * @example "solomon-ai-react@2.1.0" */ wrapperSdkVersion?: string; /** * Middleware to apply to all requests. * * Middleware allows you to intercept and modify requests and responses, * add logging, metrics collection, caching, and other cross-cutting concerns. * * @example * ```typescript * import { createLoggingMiddleware } from '@solomonai/fwb-client/middleware'; * * const client = new FinancialWorkspaceBackendClient({ * rootKey: 'fwb_123', * middleware: [ * createLoggingMiddleware({ logRequests: true, logResponses: true }) * ] * }); * ``` */ middleware?: Middleware[]; /** * Plugins to extend the client with additional functionality. * * Plugins can add new methods, middleware, and capabilities to the client. * They provide a way to package and reuse common functionality. * * @example Metrics and Logging Configuration * ```typescript * import { createMetricsPlugin, createLoggerPlugin, LogLevel } from '@solomonai/fwb-client/plugins'; * * const client = new FinancialWorkspaceBackendClient({ * rootKey: 'fwb_123', * plugins: [ * { * plugin: createMetricsPlugin(), * options: { * enableOTel: true, * otelExportEndpoint: 'https://otlp.example.com/v1/metrics', * otelExportHeaders: { 'Authorization': 'Bearer token' }, * enableTiming: true * } * }, * { * plugin: createLoggerPlugin(), * options: { * logLevel: LogLevel.INFO, * format: 'text', * useColors: true, * logRequests: true, * logErrors: true * } * } * ] * }); * ``` */ plugins?: Array<{ plugin: Plugin; options?: Record; }>; }; /** * Standard result type for all API operations. * * This is a discriminated union that represents either a successful result * or an error. This pattern ensures that you always handle both success * and error cases when working with API responses. * * @template R The type of the successful result data * * @example * ```typescript * const result = await client.keys.verify({ key: 'key_123' }); * * if (result.error) { * console.error(`API Error ${result.error.code}: ${result.error.message}`); * console.log(`See docs: ${result.error.docs}`); * console.log(`Request ID: ${result.error.requestId}`); * return; * } * * // TypeScript knows that result.result is available and result.error is not * console.log('Key is valid:', result.result.valid); * ``` */ type Result = { /** * The successful result data from the API. * Only available when the request succeeds. */ result: R; /** * Error information is not present in successful responses. * @internal */ error?: never; } | { /** * Result data is not present in error responses. * @internal */ result?: never; /** * Detailed error information when the request fails. */ error: { /** * Machine-readable error code for programmatic handling. * @example "INVALID_KEY" * @example "RATE_LIMITED" * @example "INSUFFICIENT_PERMISSIONS" */ code: ErrorResponse["error"]["code"]; /** * Human-readable error message describing what went wrong. * @example "The provided key is invalid or has been revoked" */ message: ErrorResponse["error"]["message"]; /** * URL to documentation that provides more information about this error. * @example "https://docs.solomon-ai.app/errors#invalid-key" */ docs: ErrorResponse["error"]["docs"]; /** * Unique identifier for this request, useful for debugging and support. * Include this in support requests for faster resolution. * @example "req_1234567890abcdef" */ requestId: string; }; }; /** * Main client class for interacting with the Financial Workspace Backend API. * * This class provides a comprehensive TypeScript SDK for all Financial Workspace Backend * API endpoints, including AI-powered transaction analysis, banking integrations, * key management, permissions, rate limiting, and more. * * The client is designed with type safety, automatic retries, comprehensive error handling, * and built-in telemetry to provide the best developer experience. * * @public * @class FinancialWorkspaceBackendClient * * @example Basic Usage * ```typescript * import { FinancialWorkspaceBackendClient } from '@solomonai/financial-workspace-backend'; * * const client = new FinancialWorkspaceBackendClient({ * rootKey: 'fwb_1234567890abcdef', * baseUrl: 'https://api.solomon-ai.app' * }); * * // Verify an API key * const result = await client.keys.verify({ key: 'key_123' }); * if (result.error) { * console.error('Verification failed:', result.error.message); * } else { * console.log('Key valid:', result.result.valid); * } * ``` * * @example AI-Powered Transaction Analysis * ```typescript * // Enrich transaction data with AI * const enrichResult = await client.ai.enrich({ * data: [{ * id: 'txn_123', * description: 'UBER TRIP', * amount: 2500, * currency: 'USD' * }] * }); * * if (!enrichResult.error) { * console.log('Enriched categories:', enrichResult.result.enrichedTransactions); * } * ``` * * @example Banking Integration * ```typescript * // Create a Plaid link token * const linkResult = await client.banking.plaid.link({ * userId: 'user_123', * products: ['transactions', 'accounts'] * }); * * if (!linkResult.error) { * console.log('Link token:', linkResult.result.linkToken); * } * ``` * * @see {@link ClientOptions} for configuration options * @see {@link https://docs.solomon-ai.app} for complete API documentation */ declare class FinancialWorkspaceBackendClient { /** * The base URL for all API requests. * @readonly * @public */ readonly baseUrl: string; /** * The API key used for authentication. * @readonly * @private */ private readonly rootKey; /** * Default API ID for operations. * @readonly * @private */ private readonly defaultApiId?; /** * HTTP cache configuration for requests. * @readonly * @private */ private readonly cache?; /** * Telemetry collector instance for usage analytics. * @readonly * @private */ private readonly telemetry?; /** * Retry configuration for failed requests. * @readonly * @public */ readonly retry: { /** Maximum number of retry attempts */ attempts: number; /** Function to calculate delay between retries */ backoff: (retryCount: number) => number; }; /** * Creates a new instance of the Financial Workspace Backend client. * * @param opts - Configuration options for the client * * @throws {Error} When no valid authentication key is provided * * @example * ```typescript * const client = new FinancialWorkspaceBackendClient({ * rootKey: 'fwb_1234567890abcdef', * baseUrl: 'https://api.solomon-ai.app', * retry: { * attempts: 3, * backoff: (count) => Math.pow(2, count) * 1000 * }, * disableTelemetry: true * }); * ``` */ constructor(opts: ClientOptions); /** * Generates HTTP headers for API requests. * * This method constructs the standard headers required for all API requests, * including authentication, content type, and telemetry information. * * @private * @returns Headers object containing authorization and telemetry data * * @example Headers Generated: * ``` * { * "Content-Type": "application/json", * "Authorization": "Bearer fwb_1234567890abcdef", * "Unkey-Telemetry-SDK": "@solomonai/fwb-client@2.0.0", * "Unkey-Telemetry-Platform": "vercel", * "Unkey-Telemetry-Runtime": "node@18.17.0" * } * ``` */ private getHeaders; /** * Internal method for making HTTP requests to the API with automatic retries. * * This method handles the low-level HTTP communication, including: * - URL construction from path segments * - Query parameter serialization * - Request body JSON serialization * - Automatic retries with exponential backoff * - Error handling and response parsing * - Telemetry data collection * * @template TResult The expected type of the successful response data * @param req - The request configuration object * @returns Promise resolving to either success result or error details * * @private * * @example Internal Usage: * ```typescript * const result = await this.fetch({ * path: ['v1', 'keys', 'verify'], * method: 'POST', * body: { key: 'key_123' } * }); * ``` */ private fetch; /** * Health check and service monitoring endpoints. * * These endpoints allow you to monitor the health and availability of the * Financial Workspace Backend API. Use these for uptime monitoring, health checks * in load balancers, and service discovery systems. * * @public * @readonly * * @example * ```typescript * // Check if the API is healthy and responding * const healthCheck = await client.liveness.check(); * * if (healthCheck.error) { * console.error('API is down:', healthCheck.error.message); * } else { * console.log('API is healthy:', healthCheck.result.status); * } * ``` */ get liveness(): { /** * Performs a health check on the Financial Workspace Backend API. * * This endpoint returns the current health status of the API, including * service availability, database connectivity, and any ongoing maintenance. * Use this for monitoring and alerting systems. * * @returns Promise resolving to the health status information * * @example * ```typescript * const health = await client.liveness.check(); * * if (!health.error) { * console.log('Service status:', health.result.status); * console.log('Response time:', health.result.responseTime); * console.log('Version:', health.result.version); * } * ``` */ check: () => Promise>; }; /** * API key management endpoints. * * These endpoints provide comprehensive key lifecycle management including creation, * verification, permissions, roles, and analytics. Keys are the primary method of * authentication for accessing protected resources in your application. * * @public * @readonly * * @example Creating and verifying a key * ```typescript * // Create a new API key * const newKey = await client.keys.create({ * apiId: 'api_123', * prefix: 'sk', * meta: { userId: 'user_456' } * }); * * if (!newKey.error) { * console.log('Created key:', newKey.result.key); * * // Verify the key works * const verification = await client.keys.verify({ * key: newKey.result.key * }); * * console.log('Key valid:', verification.result?.valid); * } * ``` * * @example Permission management * ```typescript * // Add permissions to a key * await client.keys.addPermissions({ * keyId: 'key_123', * permissions: ['read:users', 'write:posts'] * }); * * // Verify key with permission check * const verification = await client.keys.verify({ * key: 'sk_123', * authorization: { * permissions: { * and: ['read:users'] * } * } * }); * ``` */ get keys(): { /** * Creates a new fluent builder for API key creation. * * The builder pattern provides a more intuitive way to create API keys * with method chaining, type safety, and validation capabilities. * * @returns A new KeyBuilder instance for fluent API key creation * * @example Using the builder pattern * ```typescript * const result = await client.keys.builder() * .forApi('api_123456') * .withName('Production API Key') * .withPermissions(['read:users', 'write:posts']) * .withExpiration(Date.now() + 86400000) // 24 hours * .withMetadata({ * environment: 'production', * team: 'backend' * }) * .withRateLimit({ * type: 'fast', * limit: 1000, * refillRate: 100, * refillInterval: 60000 * }) * .create(); * * if (!result.error) { * console.log('Created key:', result.result.key); * } * ``` * * @example Validation and error handling * ```typescript * const builder = client.keys.builder() * .forApi('api_123') * .withName('Test Key'); * * const validation = builder.validate(); * if (validation.valid) { * const result = await builder.create(); * } else { * console.error('Configuration errors:', validation.errors); * } * ``` */ builder: () => KeyBuilder; /** * Creates a fluent builder for key verification with type-safe permissions. * * This method provides a more expressive way to verify keys with complex * permission requirements using method chaining. * * @param key - The API key to verify * @returns A new KeyVerificationBuilder instance * * @example Basic key verification * ```typescript * const result = await client.keys.verifyWith('sk_123456') * .requireAllPermissions(['read:users', 'write:posts']) * .execute(); * * if (!result.error && result.result.valid) { * console.log('Key is valid and has required permissions'); * } * ``` * * @example Complex permission logic * ```typescript * const result = await client.keys.verifyWith('sk_123456') * .withPermissionQuery({ * or: [ * { and: ['admin:system'] }, * { and: ['read:users', 'write:users'] } * ] * }) * .execute(); * ``` */ verifyWith: (key: string) => KeyVerificationBuilder; /** * Creates a new API key with optional configuration. * * This endpoint generates a new API key that can be used to authenticate * requests to your API. Keys can be configured with metadata, expiration, * rate limits, and other security settings. * * @param req - Key creation configuration * @returns Promise resolving to the created key details * * @example Basic key creation * ```typescript * const result = await client.keys.create({ * apiId: 'api_123', * prefix: 'sk', * meta: { * userId: 'user_456', * environment: 'production' * } * }); * * if (!result.error) { * console.log('New key:', result.result.key); * console.log('Key ID:', result.result.keyId); * } * ``` * * @example Key with expiration and limits * ```typescript * const result = await client.keys.create({ * apiId: 'api_123', * expires: Date.now() + (30 * 24 * 60 * 60 * 1000), // 30 days * ratelimit: { * type: 'fast', * limit: 1000, * refillRate: 100, * refillInterval: 60000 * } * }); * ``` */ create: (req: paths["/v1/keys.createKey"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Retrieves information about the current API key being used for authentication. * * This endpoint returns detailed information about the key making the request, * including its permissions, metadata, remaining usage, and associated API details. * Useful for validating key capabilities and debugging authorization issues. * * @param req - The key identification request * @returns Promise resolving to key information and metadata * * @example * ```typescript * const keyInfo = await client.keys.whoami({ * key: 'sk_1234567890abcdef' * }); * * if (!keyInfo.error) { * console.log('Key ID:', keyInfo.result.id); * console.log('Permissions:', keyInfo.result.permissions); * console.log('Remaining uses:', keyInfo.result.remaining); * console.log('API name:', keyInfo.result.api.name); * } * ``` */ whoami: (req: paths["/v1/keys.whoami"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Adds new permissions to an existing API key. * * This endpoint allows you to grant additional permissions to a key without * affecting its existing permissions. The new permissions will be merged with * the key's current permission set. * * @param req - The key ID and permissions to add * @returns Promise resolving to the updated key information * * @example * ```typescript * const result = await client.keys.addPermissions({ * keyId: 'key_123', * permissions: ['read:analytics', 'write:webhooks'] * }); * * if (!result.error) { * console.log('Permissions added successfully'); * console.log('Total permissions:', result.result.permissions); * } * ``` */ addPermissions: (req: paths["/v1/keys.addPermissions"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Sets the complete permission set for an API key, replacing all existing permissions. * * This endpoint completely replaces the key's current permissions with the provided list. * Any permissions not included in the request will be removed from the key. * Use `addPermissions` if you want to add permissions without affecting existing ones. * * @param req - The key ID and complete permissions list * @returns Promise resolving to the updated key information * * @example * ```typescript * const result = await client.keys.setPermissions({ * keyId: 'key_123', * permissions: ['read:users', 'write:users', 'admin:system'] * }); * * if (!result.error) { * console.log('Permissions set successfully'); * console.log('New permissions:', result.result.permissions); * } * ``` */ setPermissions: (req: paths["/v1/keys.setPermissions"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Removes specific permissions from an API key. * * This endpoint removes the specified permissions from the key's current * permission set. Permissions not included in the request will remain unchanged. * * @param req - The key ID and permissions to remove * @returns Promise resolving to the updated key information * * @example * ```typescript * const result = await client.keys.removePermissions({ * keyId: 'key_123', * permissions: ['admin:system', 'delete:users'] * }); * * if (!result.error) { * console.log('Permissions removed successfully'); * console.log('Remaining permissions:', result.result.permissions); * } * ``` */ removePermissions: (req: paths["/v1/keys.removePermissions"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Adds role assignments to an existing API key. * * This endpoint assigns additional roles to a key, granting it all permissions * associated with those roles. The new roles will be merged with the key's * current role assignments. * * @param req - The key ID and roles to add * @returns Promise resolving to the updated key information * * @example * ```typescript * const result = await client.keys.addRoles({ * keyId: 'key_123', * roles: ['reader', 'analytics-viewer'] * }); * * if (!result.error) { * console.log('Roles added successfully'); * console.log('Current roles:', result.result.roles); * } * ``` */ addRoles: (req: paths["/v1/keys.addRoles"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Removes specific role assignments from an API key. * * This endpoint removes the specified roles from the key's current role assignments. * The key will lose all permissions associated with the removed roles. * Roles not included in the request will remain unchanged. * * @param req - The key ID and roles to remove * @returns Promise resolving to the updated key information * * @example * ```typescript * const result = await client.keys.removeRoles({ * keyId: 'key_123', * roles: ['admin', 'write-access'] * }); * * if (!result.error) { * console.log('Roles removed successfully'); * console.log('Remaining roles:', result.result.roles); * } * ``` */ removeRoles: (req: paths["/v1/keys.removeRoles"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Sets the complete role assignment for an API key, replacing all existing roles. * * This endpoint completely replaces the key's current role assignments with the provided list. * Any roles not included in the request will be removed from the key. * Use `addRoles` if you want to add roles without affecting existing ones. * * @param req - The key ID and complete roles list * @returns Promise resolving to the updated key information * * @example * ```typescript * const result = await client.keys.setRoles({ * keyId: 'key_123', * roles: ['reader', 'api-consumer', 'webhook-manager'] * }); * * if (!result.error) { * console.log('Roles set successfully'); * console.log('New roles:', result.result.roles); * } * ``` */ setRoles: (req: paths["/v1/keys.setRoles"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Updates an existing API key's configuration and metadata. * * This endpoint allows you to modify various aspects of an existing key, * including its name, metadata, enabled status, and other configuration settings. * Only the fields you provide will be updated; others will remain unchanged. * * @param req - The key ID and update parameters * @returns Promise resolving to the updated key information * * @example * ```typescript * const result = await client.keys.update({ * keyId: 'key_123', * name: 'Updated API Key', * meta: { * environment: 'production', * version: '2.0' * }, * enabled: false * }); * * if (!result.error) { * console.log('Key updated successfully'); * console.log('Updated key:', result.result); * } * ``` */ update: (req: paths["/v1/keys.updateKey"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Verifies an API key and optionally checks specific permissions. * * This is the primary endpoint for authenticating and authorizing API requests. * It checks if the key is valid, active, and has the required permissions. * The response includes key metadata, usage information, and verification results. * * @template TPermission - Type for permission strings (for better type safety) * @param req - The key to verify and optional permission requirements * @returns Promise resolving to verification results and key information * * @example Basic key verification * ```typescript * const result = await client.keys.verify({ * key: 'sk_1234567890abcdef' * }); * * if (!result.error) { * console.log('Key is valid:', result.result.valid); * console.log('Key ID:', result.result.keyId); * console.log('API name:', result.result.meta?.api?.name); * } * ``` * * @example Verification with permission checks * ```typescript * const result = await client.keys.verify({ * key: 'sk_1234567890abcdef', * authorization: { * permissions: { * and: ['read:users', 'write:posts'] * } * } * }); * * if (!result.error && result.result.valid) { * console.log('Key has required permissions'); * } * ``` * * @example Complex permission logic * ```typescript * const result = await client.keys.verify({ * key: 'sk_1234567890abcdef', * authorization: { * permissions: { * or: [ * { and: ['admin:system'] }, * { and: ['read:users', 'write:users'] } * ] * } * } * }); * ``` */ verify: (req: Omit & { authorization?: { permissions: PermissionQuery; }; }) => Promise>; /** * Permanently deletes an API key. * * This endpoint permanently removes an API key from the system. The key will * immediately become invalid and cannot be recovered. Use with caution. * * @param req - The key ID to delete * @returns Promise resolving to deletion confirmation * * @example * ```typescript * const result = await client.keys.delete({ * keyId: 'key_123' * }); * * if (!result.error) { * console.log('Key deleted successfully'); * } * ``` */ delete: (req: paths["/v1/keys.deleteKey"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Updates the remaining usage count for an API key. * * This endpoint allows you to manually adjust the remaining usage count for a key. * Useful for implementing custom billing logic, granting additional usage credits, * or resetting usage counters. * * @param req - The key ID and new remaining count * @returns Promise resolving to the updated key information * * @example * ```typescript * const result = await client.keys.updateRemaining({ * keyId: 'key_123', * op: 'set', * value: 1000 * }); * * if (!result.error) { * console.log('Usage updated successfully'); * console.log('New remaining count:', result.result.remaining); * } * ``` * * @example Increment usage allowance * ```typescript * const result = await client.keys.updateRemaining({ * keyId: 'key_123', * op: 'increment', * value: 500 * }); * ``` */ updateRemaining: (req: paths["/v1/keys.updateRemaining"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Retrieves detailed information about a specific API key. * * This endpoint returns comprehensive information about a key including its * configuration, metadata, permissions, usage statistics, and creation details. * * @param req - Query parameters including the key ID * @returns Promise resolving to the key information * * @example * ```typescript * const result = await client.keys.get({ * keyId: 'key_123' * }); * * if (!result.error) { * const key = result.result; * console.log('Key name:', key.name); * console.log('Created:', new Date(key.createdAt)); * console.log('Permissions:', key.permissions); * console.log('Usage:', key.usage); * console.log('Remaining:', key.remaining); * } * ``` */ get: (req: paths["/v1/keys.getKey"]["get"]["parameters"]["query"]) => Promise>; /** * Retrieves verification logs and analytics for an API key. * * This endpoint returns a paginated list of verification attempts for a specific key, * including successful and failed attempts, timestamps, and associated metadata. * Useful for monitoring key usage patterns and debugging authentication issues. * * @param req - Query parameters including key ID and pagination options * @returns Promise resolving to verification log entries * * @example * ```typescript * const result = await client.keys.getVerifications({ * keyId: 'key_123', * limit: 50, * offset: 0 * }); * * if (!result.error) { * console.log('Total verifications:', result.result.total); * result.result.verifications.forEach(v => { * console.log(`${v.time}: ${v.success ? 'SUCCESS' : 'FAILED'} - ${v.requestId}`); * }); * } * ``` */ getVerifications: (req: paths["/v1/keys.getVerifications"]["get"]["parameters"]["query"]) => Promise>; }; /** * API management endpoints. * * These endpoints provide comprehensive management of API configurations, * including creation, deletion, key management, and analytics. APIs represent * the top-level containers for organizing and managing access to your services. * * @public * @readonly * * @example Creating and managing an API * ```typescript * // Create a new API * const newApi = await client.apis.create({ * name: 'My Service API', * workspaceId: 'ws_123' * }); * * if (!newApi.error) { * console.log('API created:', newApi.result.id); * * // Get API details * const apiDetails = await client.apis.get({ * apiId: newApi.result.id * }); * * // List all keys for this API * const keys = await client.apis.listKeys({ * apiId: newApi.result.id * }); * } * ``` */ get apis(): { /** * Creates a new fluent builder for API creation. * * The builder pattern provides a more intuitive way to create APIs * with method chaining, validation, and a cleaner API. * * @returns A new ApiBuilder instance for fluent API creation * * @example Using the builder pattern * ```typescript * const result = await client.apis.builder() * .withName('Payment Processing API') * .create(); * * if (!result.error) { * console.log('Created API:', result.result.id); * } * ``` * * @example With validation * ```typescript * const builder = client.apis.builder() * .withName('My API'); * * const validation = builder.validate(); * if (validation.valid) { * const result = await builder.create(); * } else { * console.error('Validation errors:', validation.errors); * } * ``` */ builder: () => ApiBuilder; /** * Creates a new API configuration. * * This endpoint creates a new API container that can be used to organize * and manage API keys, permissions, and access controls for your service. * * @param req - API creation configuration * @returns Promise resolving to the created API details * * @example * ```typescript * const result = await client.apis.create({ * name: 'Payment Processing API', * workspaceId: 'ws_123456' * }); * * if (!result.error) { * console.log('API created successfully'); * console.log('API ID:', result.result.id); * console.log('API Name:', result.result.name); * } * ``` */ create: (req: paths["/v1/apis.createApi"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Permanently deletes an API configuration. * * This endpoint permanently removes an API and all of its associated keys. * All keys belonging to this API will be immediately invalidated and cannot * be recovered. Use with extreme caution. * * @param req - The API ID to delete * @returns Promise resolving to deletion confirmation * * @example * ```typescript * const result = await client.apis.delete({ * apiId: 'api_123456' * }); * * if (!result.error) { * console.log('API deleted successfully'); * } * ``` */ delete: (req: paths["/v1/apis.deleteApi"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Deletes multiple API keys belonging to a specific API. * * This endpoint allows you to delete multiple keys at once for bulk operations. * All specified keys will be immediately invalidated and cannot be recovered. * * @param req - The API ID and array of key IDs to delete * @returns Promise resolving to deletion results * * @example * ```typescript * const result = await client.apis.deleteKeys({ * apiId: 'api_123456', * keyIds: ['key_123', 'key_456', 'key_789'] * }); * * if (!result.error) { * console.log('Keys deleted successfully'); * console.log('Deleted count:', result.result.deleted); * } * ``` */ deleteKeys: (req: paths["/v1/apis.deleteKeys"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Retrieves detailed information about a specific API. * * This endpoint returns comprehensive information about an API including its * configuration, metadata, key statistics, and usage information. * * @param req - Query parameters including the API ID * @returns Promise resolving to the API information * * @example * ```typescript * const result = await client.apis.get({ * apiId: 'api_123456' * }); * * if (!result.error) { * const api = result.result; * console.log('API name:', api.name); * console.log('Created:', new Date(api.createdAt)); * console.log('Total keys:', api.keyCount); * console.log('Workspace:', api.workspaceId); * } * ``` */ get: (req: paths["/v1/apis.getApi"]["get"]["parameters"]["query"]) => Promise>; /** * Lists all API keys belonging to a specific API. * * This endpoint returns a paginated list of all keys associated with an API, * including their metadata, usage statistics, and current status. * * @param req - Query parameters including API ID and pagination options * @returns Promise resolving to the list of API keys * * @example * ```typescript * const result = await client.apis.listKeys({ * apiId: 'api_123456', * limit: 25, * offset: 0 * }); * * if (!result.error) { * console.log('Total keys:', result.result.total); * result.result.keys.forEach(key => { * console.log(`Key: ${key.id} - ${key.name || 'Unnamed'} - ${key.enabled ? 'Enabled' : 'Disabled'}`); * }); * } * ``` */ listKeys: (req: paths["/v1/apis.listKeys"]["get"]["parameters"]["query"]) => Promise>; }; /** * Permission and role management endpoints. * * These endpoints provide comprehensive management of permissions and roles * for implementing fine-grained access control in your applications. * Permissions represent individual capabilities, while roles are collections * of permissions that can be assigned to API keys. * * @public * @readonly * * @example Setting up permissions and roles * ```typescript * // Create individual permissions * const readPerm = await client.permissions.createPermission({ * name: 'read:users', * description: 'Read user data' * }); * * const writePerm = await client.permissions.createPermission({ * name: 'write:users', * description: 'Create and update user data' * }); * * // Create a role with multiple permissions * const userRole = await client.permissions.createRole({ * name: 'user-manager', * description: 'Can manage user accounts', * permissions: ['read:users', 'write:users'] * }); * * // Assign role to an API key * await client.keys.addRoles({ * keyId: 'key_123', * roles: ['user-manager'] * }); * ``` */ get permissions(): { /** * Creates a new fluent builder for role creation. * * The builder pattern provides an intuitive way to create roles * with method chaining and validation. * * @returns A new RoleBuilder instance for fluent role creation * * @example Using the role builder * ```typescript * const result = await client.permissions.roleBuilder() * .withName('content-manager') * .withDescription('Can manage content and posts') * .create(); * * if (!result.error) { * console.log('Created role:', result.result.id); * } * ``` */ roleBuilder: () => RoleBuilder; /** * Creates a new fluent builder for permission creation. * * The builder pattern provides an intuitive way to create permissions * with method chaining and validation. * * @returns A new PermissionBuilder instance for fluent permission creation * * @example Using the permission builder * ```typescript * const result = await client.permissions.permissionBuilder() * .withName('manage:webhooks') * .withDescription('Permission to create and manage webhooks') * .create(); * * if (!result.error) { * console.log('Created permission:', result.result.id); * } * ``` */ permissionBuilder: () => PermissionBuilder; /** * Creates a new role with specified permissions. * * Roles are collections of permissions that can be assigned to API keys * for simplified access control management. This endpoint creates a new * role and assigns it the specified permissions. * * @param req - Role creation configuration * @returns Promise resolving to the created role details * * @example * ```typescript * const result = await client.permissions.createRole({ * name: 'content-editor', * description: 'Can create and edit content', * permissions: ['read:posts', 'write:posts', 'edit:posts'] * }); * * if (!result.error) { * console.log('Role created:', result.result.id); * console.log('Role name:', result.result.name); * } * ``` */ createRole: (req: paths["/v1/permissions.createRole"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Retrieves detailed information about a specific role. * * This endpoint returns comprehensive information about a role including * its permissions, description, and usage statistics. * * @param req - Query parameters including the role ID * @returns Promise resolving to the role information * * @example * ```typescript * const result = await client.permissions.getRole({ * roleId: 'role_123' * }); * * if (!result.error) { * console.log('Role name:', result.result.name); * console.log('Description:', result.result.description); * console.log('Permissions:', result.result.permissions); * } * ``` */ getRole: (req: paths["/v1/permissions.getRole"]["get"]["parameters"]["query"]) => Promise>; /** * Lists all roles in the workspace. * * This endpoint returns a paginated list of all roles with their * basic information and permission counts. * * @param req - Optional query parameters for filtering and pagination * @returns Promise resolving to the list of roles * * @example * ```typescript * const result = await client.permissions.listRoles({ * limit: 20, * offset: 0 * }); * * if (!result.error) { * console.log('Total roles:', result.result.total); * result.result.roles.forEach(role => { * console.log(`${role.name}: ${role.permissions.length} permissions`); * }); * } * ``` */ listRoles: (req?: paths["/v1/permissions.listRoles"]["get"]["parameters"]["query"]) => Promise>; /** * Permanently deletes a role. * * This endpoint permanently removes a role from the system. Any API keys * that were assigned this role will lose the associated permissions. * * @param req - The role ID to delete * @returns Promise resolving to deletion confirmation * * @example * ```typescript * const result = await client.permissions.deleteRole({ * roleId: 'role_123' * }); * * if (!result.error) { * console.log('Role deleted successfully'); * } * ``` */ deleteRole: (req: paths["/v1/permissions.deleteRole"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Creates a new permission. * * Permissions represent individual capabilities or actions that can be * granted to API keys. They are the building blocks for role-based access control. * * @param req - Permission creation configuration * @returns Promise resolving to the created permission details * * @example * ```typescript * const result = await client.permissions.createPermission({ * name: 'delete:posts', * description: 'Permission to delete blog posts' * }); * * if (!result.error) { * console.log('Permission created:', result.result.id); * console.log('Permission name:', result.result.name); * } * ``` */ createPermission: (req: paths["/v1/permissions.createPermission"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Retrieves detailed information about a specific permission. * * This endpoint returns information about a permission including its * name, description, and usage statistics. * * @param req - Query parameters including the permission ID * @returns Promise resolving to the permission information * * @example * ```typescript * const result = await client.permissions.getPermission({ * permissionId: 'perm_123' * }); * * if (!result.error) { * console.log('Permission name:', result.result.name); * console.log('Description:', result.result.description); * console.log('Created:', new Date(result.result.createdAt)); * } * ``` */ getPermission: (req: paths["/v1/permissions.getPermission"]["get"]["parameters"]["query"]) => Promise>; /** * Lists all permissions in the workspace. * * This endpoint returns a paginated list of all permissions with their * basic information and usage statistics. * * @param req - Optional query parameters for filtering and pagination * @returns Promise resolving to the list of permissions * * @example * ```typescript * const result = await client.permissions.listPermissions({ * limit: 50, * offset: 0 * }); * * if (!result.error) { * console.log('Total permissions:', result.result.total); * result.result.permissions.forEach(perm => { * console.log(`${perm.name}: ${perm.description}`); * }); * } * ``` */ listPermissions: (req?: paths["/v1/permissions.listPermissions"]["get"]["parameters"]["query"]) => Promise>; /** * Permanently deletes a permission. * * This endpoint permanently removes a permission from the system. Any roles * or API keys that had this permission will lose it immediately. * * @param req - The permission ID to delete * @returns Promise resolving to deletion confirmation * * @example * ```typescript * const result = await client.permissions.deletePermission({ * permissionId: 'perm_123' * }); * * if (!result.error) { * console.log('Permission deleted successfully'); * } * ``` */ deletePermission: (req: paths["/v1/permissions.deletePermission"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; }; /** * Rate limiting and quota management endpoints. * * These endpoints provide advanced rate limiting capabilities including * checking rate limits, setting per-key overrides, and managing quota * allocations for fine-grained API usage control. * * @public * @readonly * * @example Basic rate limiting check * ```typescript * // Check if an identifier is rate limited * const result = await client.ratelimits.limit({ * namespace: 'user-actions', * identifier: 'user_123', * limit: 10, * duration: 60000 // 1 minute * }); * * if (!result.error) { * if (result.result.pass) { * console.log('Request allowed'); * console.log('Remaining:', result.result.remaining); * } else { * console.log('Rate limited. Try again in:', result.result.reset); * } * } * ``` * * @example Setting rate limit overrides * ```typescript * // Set a custom rate limit for a specific API key * await client.ratelimits.setOverride({ * namespace: 'api-calls', * identifier: 'key_123', * limit: 1000, * duration: 3600000 // 1 hour * }); * ``` */ get ratelimits(): { /** * Performs a rate limiting check for a specific identifier. * * This endpoint checks if a request should be allowed based on the current * rate limit configuration. It returns the current state and remaining quota. * * @param req - Rate limit check parameters * @returns Promise resolving to rate limit decision and current state * * @example * ```typescript * const result = await client.ratelimits.limit({ * namespace: 'user-api-calls', * identifier: 'user_123', * limit: 100, * duration: 3600000 // 1 hour in milliseconds * }); * * if (!result.error) { * if (result.result.pass) { * console.log('Request allowed'); * console.log('Remaining requests:', result.result.remaining); * console.log('Reset time:', new Date(result.result.reset)); * } else { * console.log('Rate limited!'); * console.log('Retry after:', new Date(result.result.reset)); * } * } * ``` */ limit: (req: paths["/v1/ratelimits.limit"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Retrieves rate limit override configuration for a specific identifier. * * This endpoint returns the custom rate limit settings that have been * configured for a particular namespace and identifier combination. * * @param req - Query parameters including namespace and identifier * @returns Promise resolving to the override configuration * * @example * ```typescript * const result = await client.ratelimits.getOverride({ * namespace: 'premium-users', * identifier: 'user_123' * }); * * if (!result.error) { * console.log('Override limit:', result.result.limit); * console.log('Override duration:', result.result.duration); * } * ``` */ getOverride: (req: paths["/v1/ratelimits.getOverride"]["get"]["parameters"]["query"]) => Promise>; /** * Lists all rate limit overrides for a specific namespace. * * This endpoint returns a paginated list of all custom rate limit * configurations that have been set for identifiers in the specified namespace. * * @param req - Query parameters including namespace and pagination options * @returns Promise resolving to the list of rate limit overrides * * @example * ```typescript * const result = await client.ratelimits.listOverrides({ * namespace: 'api-keys', * limit: 25, * offset: 0 * }); * * if (!result.error) { * console.log('Total overrides:', result.result.total); * result.result.overrides.forEach(override => { * console.log(`${override.identifier}: ${override.limit}/${override.duration}ms`); * }); * } * ``` */ listOverrides: (req: paths["/v1/ratelimits.listOverrides"]["get"]["parameters"]["query"]) => Promise>; /** * Sets a custom rate limit override for a specific identifier. * * This endpoint creates or updates a rate limit override that will be used * instead of the default rate limit configuration for the specified identifier. * * @param req - Rate limit override configuration * @returns Promise resolving to the created/updated override * * @example * ```typescript * const result = await client.ratelimits.setOverride({ * namespace: 'premium-users', * identifier: 'user_123', * limit: 1000, * duration: 3600000 // 1 hour * }); * * if (!result.error) { * console.log('Override created successfully'); * } * ``` */ setOverride: (req: paths["/v1/ratelimits.setOverride"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Removes a rate limit override for a specific identifier. * * This endpoint deletes a custom rate limit override, causing the identifier * to fall back to the default rate limit configuration. * * @param req - The namespace and identifier of the override to delete * @returns Promise resolving to deletion confirmation * * @example * ```typescript * const result = await client.ratelimits.deleteOverride({ * namespace: 'premium-users', * identifier: 'user_123' * }); * * if (!result.error) { * console.log('Override deleted successfully'); * } * ``` */ deleteOverride: (req: paths["/v1/ratelimits.deleteOverride"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; }; /** * Identity management endpoints. * * These endpoints provide management of user identities and their associated * metadata for implementing user-based access control and tracking. * Identities can be linked to API keys for user-specific operations. * * @public * @readonly * * @example Creating and managing identities * ```typescript * // Create a new identity * const identity = await client.identities.create({ * externalId: 'user_123', * meta: { * email: 'user@example.com', * plan: 'premium' * } * }); * * if (!identity.error) { * console.log('Identity created:', identity.result.id); * * // Get identity details * const details = await client.identities.get({ * identityId: identity.result.id * }); * } * ``` */ get identities(): { /** * Creates a new identity record. * * This endpoint creates a new identity that can be associated with API keys * for user-specific operations and access control. * * @param req - Identity creation configuration * @returns Promise resolving to the created identity details * * @example * ```typescript * const result = await client.identities.create({ * externalId: 'user_456', * meta: { * email: 'alice@company.com', * department: 'engineering', * role: 'senior-developer' * } * }); * * if (!result.error) { * console.log('Identity created:', result.result.id); * console.log('External ID:', result.result.externalId); * } * ``` */ create: (req: paths["/v1/identities.createIdentity"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; /** * Retrieves detailed information about a specific identity. * * This endpoint returns comprehensive information about an identity including * its metadata, associated keys, and usage statistics. * * @param req - Query parameters including the identity ID * @returns Promise resolving to the identity information * * @example * ```typescript * const result = await client.identities.get({ * identityId: 'id_123' * }); * * if (!result.error) { * console.log('External ID:', result.result.externalId); * console.log('Metadata:', result.result.meta); * console.log('Created:', new Date(result.result.createdAt)); * } * ``` */ get: (req: paths["/v1/identities.getIdentity"]["get"]["parameters"]["query"]) => Promise>; list: (req: paths["/v1/identities.listIdentities"]["get"]["parameters"]["query"]) => Promise>; delete: (req: paths["/v1/identities.deleteIdentity"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; update: (req: paths["/v1/identities.updateIdentity"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; }; get analytics(): { getVerifications: (req: paths["/v1/analytics.getVerifications"]["get"]["parameters"]["query"]) => Promise>; }; get migrations(): { createKeys: (req: paths["/v1/migrations.createKeys"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; enqueueKeys: (req: paths["/v1/migrations.enqueueKeys"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; }; /** * Connection management for banking providers */ get connections(): { status: (req: paths["/v1/api.connections.status"]["get"]["parameters"]["query"]) => Promise>; delete: (req: NonNullable["content"]["application/json"]) => Promise>; gocardless: (req: operations["get.connections.gocardless"]["parameters"]["query"]) => Promise>; get: (req: paths["/v1/api.connections/{reference}"]["get"]["parameters"]["path"] & paths["/v1/api.connections/{reference}"]["get"]["parameters"]["query"]) => Promise>; /** * Get Connection Accounts * * Retrieves all accounts associated with financial connections. * This endpoint provides access to account information from various financial * providers including bank accounts, credit cards, and other financial accounts. * * @param req - Query parameters for filtering connection accounts * @returns Promise resolving to connection accounts data * * @example * ```typescript * const accounts = await client.connections.accounts({ * connectionId: 'conn_123456789' * }); * * if (accounts.result) { * console.log('Found accounts:', accounts.result.data); * } * ``` */ accounts: (req: paths["/v1/api.connections.accounts"]["get"]["parameters"]["query"]) => Promise>; /** * Get Account Balance * * Retrieves the current balance for a specific financial account. * This endpoint provides real-time balance information for bank accounts, * credit cards, and other financial accounts. * * @param req - Query parameters specifying the account * @returns Promise resolving to account balance data * * @example * ```typescript * const balance = await client.connections.accountBalance({ * accountId: 'acc_123456789', * connectionId: 'conn_123456789' * }); * * if (balance.result) { * console.log('Account balance:', balance.result.data); * } * ``` */ accountBalance: (req: paths["/v1/api.connections.accounts.balance"]["get"]["parameters"]["query"]) => Promise>; }; /** * Financial services API */ get financial(): { transactions: (req: paths["/v1/api.transactions"]["get"]["parameters"]["query"]) => Promise>; recurringTransactions: (req: paths["/v1/api.transactions/recurring"]["get"]["parameters"]["query"]) => Promise>; health: (req: paths["/v1/api.health"]["get"]["parameters"]["query"]) => Promise>; institutions: (req: paths["/v1/api.institutions"]["get"]["parameters"]["query"]) => Promise>; institutionUsage: (req: operations["update.institutions.usage"]["parameters"]["path"] & operations["update.institutions.usage"]["parameters"]["query"]) => Promise>; rates: (req: paths["/v1/api.rates"]["get"]["parameters"]["query"]) => Promise>; statements: (req: paths["/v1/api.statements"]["get"]["parameters"]["query"]) => Promise>; statementsPdf: (req: paths["/v1/api.statements/pdf"]["get"]["parameters"]["query"]) => Promise>; connections: (req: paths["/v1/api.connections.accounts"]["get"]["parameters"]["query"]) => Promise>; connectionsBalance: (req: paths["/v1/api.connections.accounts.balance"]["get"]["parameters"]["query"]) => Promise>; connectionsStatus: (req: paths["/v1/api.connections.status"]["get"]["parameters"]["query"]) => Promise>; connectionsDelete: (req: paths["/v1/api.connections.delete"]["delete"]["parameters"]["query"]) => Promise>; connectionsGet: (req: paths["/v1/api.connections/{reference}"]["get"]["parameters"]["path"] & paths["/v1/api.connections/{reference}"]["get"]["parameters"]["query"]) => Promise>; }; /** * Banking provider integrations */ get banking(): { gocardless: { link: (req: NonNullable["content"]["application/json"]) => Promise>; agreement: (req: NonNullable["content"]["application/json"]) => Promise>; exchange: (req: NonNullable["content"]["application/json"]) => Promise>; }; plaid: { link: (req: NonNullable["content"]["application/json"]) => Promise>; exchange: (req: NonNullable["content"]["application/json"]) => Promise>; }; enablebanking: { link: (req: NonNullable["content"]["application/json"]) => Promise>; exchange: (req: NonNullable["content"]["application/json"]) => Promise>; }; }; /** * Legacy endpoints for backward compatibility */ get legacy(): { keys: { create: (req: paths["/v1/legacy/keys"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; verify: (req: paths["/v1/legacy/keys/verify"]["post"]["requestBody"]["content"]["application/json"]) => Promise>; list: (req: paths["/v1/legacy/apis/{legacyApiId}/keys"]["get"]["parameters"]["path"] & paths["/v1/legacy/apis/{legacyApiId}/keys"]["get"]["parameters"]["query"]) => Promise>; }; }; /** * AI-powered transaction analysis and enrichment services. * * This comprehensive suite of AI endpoints provides advanced transaction analysis, * categorization, tax optimization, compliance checking, and business intelligence. * All endpoints use state-of-the-art machine learning models to provide accurate * and actionable insights for financial data. * * @public * @readonly * * @example Basic transaction enrichment * ```typescript * const result = await client.ai.enrich({ * data: [{ * id: 'txn_123', * date: '2024-01-15', * description: 'AMAZON.COM*RETAIL', * amount: 4999, // $49.99 in cents * currency: 'USD' * }] * }); * * if (!result.error) { * const enriched = result.result.enrichedTransactions[0]; * console.log('Category:', enriched.category); * console.log('Merchant:', enriched.merchant); * console.log('Confidence:', enriched.confidence); * } * ``` * * @example Tax compliance analysis * ```typescript * // Analyze tax categories for business expenses * const taxAnalysis = await client.ai.taxCategories.single({ * transaction: { * id: 'txn_456', * description: 'Office supplies from Staples', * amount: 12500 // $125.00 * }, * countryCode: 'US', * taxYear: 2024, * businessType: 'corporation' * }); * * if (!taxAnalysis.error) { * console.log('Tax category:', taxAnalysis.result.category); * console.log('Deductible:', taxAnalysis.result.deductible); * console.log('Documentation required:', taxAnalysis.result.documentationRequired); * } * ``` * * @example Receipt requirement analysis * ```typescript * const receiptAnalysis = await client.ai.receiptRequirements.single({ * transaction: { * id: 'txn_789', * description: 'Business dinner at The Capital Grille', * amount: 15000 // $150.00 * }, * countryCode: 'US', * taxYear: 2024, * businessType: 'sole_proprietor' * }); * * if (!receiptAnalysis.error) { * console.log('Receipt required:', receiptAnalysis.result.receiptRequired); * console.log('Threshold:', receiptAnalysis.result.threshold); * console.log('Retention period:', receiptAnalysis.result.retentionPeriod); * } * ``` */ get ai(): { /** * Enriches transaction data with AI-powered categorization and merchant identification. * * This endpoint analyzes transaction descriptions and amounts to automatically * categorize transactions, identify merchants, and extract relevant metadata. * Perfect for expense management, budgeting, and financial analytics. * * @param req - Array of transactions to enrich * @returns Promise resolving to enriched transaction data * * @example Enrich multiple transactions * ```typescript * const result = await client.ai.enrich({ * data: [ * { * id: 'txn_1', * description: 'UBER *TRIP', * amount: 1250, // $12.50 * currency: 'USD', * date: '2024-01-15' * }, * { * id: 'txn_2', * description: 'STARBUCKS #1234', * amount: 545, // $5.45 * currency: 'USD', * date: '2024-01-15' * } * ] * }); * * if (!result.error) { * result.result.enrichedTransactions.forEach(txn => { * console.log(`${txn.id}: ${txn.category} (${txn.confidence}% confident)`); * }); * } * ``` */ enrich: (req: NonNullable["content"]["application/json"]) => Promise>; /** * Provides comprehensive, detailed analysis of a single transaction. * * This advanced endpoint performs deep analysis including frequency prediction, * purpose identification, merchant details, location inference, and spending * pattern analysis. Ideal for detailed financial insights and business intelligence. * * @param req - Single transaction for detailed analysis * @returns Promise resolving to comprehensive transaction insights * * @example Detailed analysis of a business expense * ```typescript * const result = await client.ai.detailedEnrichment({ * transaction: { * id: 'txn_detailed_1', * description: 'ADOBE CREATIVE CLOUD', * amount: 5999, // $59.99 * currency: 'USD', * date: '2024-01-15' * } * }); * * if (!result.error) { * const analysis = result.result; * console.log('Category:', analysis.category); * console.log('Merchant:', analysis.merchantDetails); * console.log('Business purpose:', analysis.businessPurpose); * console.log('Frequency prediction:', analysis.frequencyPrediction); * console.log('Tax implications:', analysis.taxImplications); * } * ``` */ detailedEnrichment: (req: NonNullable["content"]["application/json"]) => Promise>; categorize: (req: NonNullable["content"]["application/json"]) => Promise>; multiModel: (req: NonNullable["content"]["application/json"]) => Promise>; taxCategories: { /** * Analyzes a single transaction to determine its tax category and deductibility. * * This endpoint classifies transactions into appropriate tax categories based on * the business type, country regulations, and transaction details. Essential for * tax preparation, compliance, and financial planning. * * @param req - Transaction and tax context for analysis * @returns Promise resolving to tax category classification * * @example Analyze office supply purchase * ```typescript * const result = await client.ai.taxCategories.single({ * transaction: { * id: 'txn_office_1', * description: 'Office Depot - Paper & Supplies', * amount: 8750, // $87.50 * currency: 'USD' * }, * countryCode: 'US', * taxYear: 2024, * businessType: 'sole_proprietor' * }); * * if (!result.error) { * console.log('Tax category:', result.result.category); * console.log('Deductible amount:', result.result.deductibleAmount); * console.log('Deduction percentage:', result.result.deductionPercentage); * console.log('IRS code:', result.result.irsCode); * } * ``` */ single: (req: NonNullable["content"]["application/json"]) => Promise>; bulk: (req: NonNullable["content"]["application/json"]) => Promise>; }; businessPurpose: { single: (req: NonNullable["content"]["application/json"]) => Promise>; bulk: (req: NonNullable["content"]["application/json"]) => Promise>; }; receiptRequirements: { single: (req: NonNullable["content"]["application/json"]) => Promise>; bulk: (req: NonNullable["content"]["application/json"]) => Promise>; }; taxDeductions: { single: (req: NonNullable["content"]["application/json"]) => Promise>; bulk: (req: NonNullable["content"]["application/json"]) => Promise>; }; perDiem: { single: (req: NonNullable["content"]["application/json"]) => Promise>; bulk: (req: NonNullable["content"]["application/json"]) => Promise>; }; workerClassification: { single: (req: NonNullable["content"]["application/json"]) => Promise>; bulk: (req: NonNullable["content"]["application/json"]) => Promise>; }; /** * Get Enrichment Analytics * * Retrieve comprehensive analytics for enrichment API usage including costs, * performance, and cache metrics. This endpoint provides insights into your * transaction enrichment service usage patterns. * * @param req - Query parameters for analytics filtering * @returns Promise resolving to enrichment analytics data * * @example * ```typescript * const analytics = await client.ai.analytics({ * apiId: 'api_123456', * startDate: '2024-01-01', * endDate: '2024-01-31', * groupBy: 'day' * }); * * if (analytics.result) { * console.log('Usage analytics:', analytics.result.data); * } * ``` */ analytics: (req: paths["/v1/api.enrich.analytics"]["get"]["parameters"]["query"]) => Promise>; }; /** * Creates a new API key with streamlined configuration. * * This convenience method allows creating keys with just the essential parameters, * using sensible defaults for everything else. Ideal for standard use cases * where full configuration complexity isn't needed. * * @param options - Simplified key creation options * @returns Promise resolving to the new key details * * @example * ```typescript * // Initialize client with default apiId * const client = new FinancialWorkspaceBackendClient({ * rootKey: 'fwb_123...', * apiId: 'api_default123' * }); * * // Create a key with just a name * const key = await client.createKey({ * name: 'Customer API Key' * }); * * // Create a key with expiration * const tempKey = await client.createKey({ * name: 'Temporary Access', * expiresIn: '24h' * }); * ``` */ createKey(options?: { name?: string; expiresIn?: string | number; ownerId?: string; permissions?: string[]; rateLimit?: number; enabled?: boolean; }): Promise>; /** * Verifies if an API key is valid. * * @param key - The key to verify * @returns Promise resolving to a boolean indicating key validity * * @example * ```typescript * const isValid = await client.isKeyValid('sk_123...'); * if (isValid) { * console.log('Key is valid!'); * } * ``` */ isKeyValid(key: string): Promise; /** * List all keys with pagination support. * * This convenience method simplifies listing keys with automatic pagination * handling and filtering options. * * @param options - Listing options * @returns Promise resolving to array of keys * * @example * ```typescript * // Get all keys * const allKeys = await client.listAllKeys(); * * // Get keys for a specific owner * const userKeys = await client.listAllKeys({ * ownerId: 'user_123' * }); * ``` */ listAllKeys(options?: { ownerId?: string; limit?: number; }): Promise; /** * Get financial transactions with enhanced filtering. * * @param options - Transaction query options (accountId is required) * @returns Promise resolving to transactions * * @example * ```typescript * // Get transactions for a specific account * const accountTxns = await client.getTransactions({ * accountId: 'acc_123' * }); * * // Get transactions with connection filtering * const connectionTxns = await client.getTransactions({ * accountId: 'acc_123', * connectionId: 'conn_456' * }); * ``` */ getTransactions(options: { accountId: string; connectionId?: string; cursor?: string; }): Promise>; /** * Get recurring transactions for a specific account. * * @param options - Recurring transaction query options (accountId is required) * @returns Promise resolving to recurring transactions * * @example * ```typescript * const recurringTransactions = await client.getRecurringTransactions({ * accountId: 'acc_123', * accessToken: 'access_123', * userId: 'user_123', * teamId: 'team_123' * }); * ``` */ getRecurringTransactions(options: { accountId: string; accessToken: string; userId: string; teamId: string; }): Promise>; /** * Enrich a single transaction with AI-powered analysis. * * @param transaction - Transaction to enrich * @returns Promise resolving to enriched transaction data * * @example * ```typescript * const enriched = await client.enrichTransaction({ * description: 'AMZN Marketplace', * amount: 49.99, * date: '2024-01-15' * }); * * console.log('Category:', enriched.result?.category); * console.log('Merchant:', enriched.result?.merchant); * ``` */ enrichTransaction(transaction: { description: string; amount: number; date?: string; currency?: string; }): Promise>; } /** * @deprecated Use FinancialWorkspaceBackendClient instead. This alias is provided for backward compatibility. */ declare const SolomonAIWorkspaceEngineSdk: typeof FinancialWorkspaceBackendClient; /** * Verify a key * * @example * ```ts * const { result, error } = await verifyKey("key_123") * if (error){ * // handle potential network or bad request error * // a link to our docs will be in the `error.docs` field * console.error(error.message) * return * } * if (!result.valid) { * // do not grant access * return * } * * // process request * console.log(result) * ``` */ declare function verifyKey(req: string | (Omit & { authorization?: { permissions: PermissionQuery; }; })): Promise<{ result?: never; error: { code: ErrorResponse["error"]["code"]; message: ErrorResponse["error"]["message"]; docs: ErrorResponse["error"]["docs"]; requestId: string; }; } | { result: { keyId?: string; valid: boolean; name?: string; ownerId?: string; meta?: { [key: string]: unknown; }; expires?: number; ratelimit?: { limit: number; remaining: number; reset: number; }; remaining?: number; code: "VALID" | "NOT_FOUND" | "FORBIDDEN" | "USAGE_EXCEEDED" | "RATE_LIMITED" | "UNAUTHORIZED" | "DISABLED" | "INSUFFICIENT_PERMISSIONS" | "EXPIRED"; enabled?: boolean; permissions?: string[]; roles?: string[]; environment?: string; identity?: { id: string; externalId: string; meta: { [key: string]: unknown; }; }; requestId: string; }; error?: never; }>; /** * @fileoverview Shared Logger Implementation * * This module provides a reusable logger class with configurable formatting, * log levels, and output options that can be shared across plugins and middleware. * * @author Solomon AI Engineering Team * @version 1.0.0 */ /** * Log level enumeration */ declare enum LogLevel { TRACE = 0, DEBUG = 1, INFO = 2, WARN = 3, ERROR = 4, FATAL = 5, OFF = 6 } /** * Zod schema for shared logger options */ declare const SharedLoggerOptionsSchema: z.ZodObject<{ /** Output format */ format: z.ZodDefault>; /** Minimum log level to output */ logLevel: z.ZodDefault>; /** Custom formatter function */ customFormatter: z.ZodOptional, z.ZodString>>; /** Whether to use colors in console output */ useColors: z.ZodDefault; /** Whether to log timestamps */ includeTimestamp: z.ZodDefault; /** Whether to log the component name in each log entry */ includeComponentName: z.ZodDefault; /** Component name for identification */ componentName: z.ZodDefault; }, "strict", z.ZodTypeAny, { format: "json" | "text" | "custom"; logLevel: LogLevel; useColors: boolean; includeTimestamp: boolean; includeComponentName: boolean; componentName: string; customFormatter?: ((args_0: any, ...args: unknown[]) => string) | undefined; }, { format?: "json" | "text" | "custom" | undefined; logLevel?: LogLevel | undefined; customFormatter?: ((args_0: any, ...args: unknown[]) => string) | undefined; useColors?: boolean | undefined; includeTimestamp?: boolean | undefined; includeComponentName?: boolean | undefined; componentName?: string | undefined; }>; /** * Configuration options for the shared logger */ type SharedLoggerOptions = z.infer; /** * Shared logger class with configurable formatting and log levels * * This class provides comprehensive logging capabilities that can be reused * across different components like plugins and middleware. * * @example Basic Usage * ```typescript * import { SharedLogger, LogLevel } from '../shared/logger'; * * const logger = new SharedLogger({ * logLevel: LogLevel.DEBUG, * format: 'text', * useColors: true, * componentName: 'metrics-plugin' * }); * * logger.info('Plugin initialized'); * logger.error('Something went wrong', { error: 'details' }); * ``` */ declare class SharedLogger { private options; private readonly colors; constructor(options?: Partial); /** * Log a trace message (most verbose) */ trace(message: string, data?: unknown): void; /** * Log a debug message */ debug(message: string, data?: unknown): void; /** * Log an info message */ info(message: string, data?: unknown): void; /** * Log a warning message */ warn(message: string, data?: unknown): void; /** * Log an error message */ error(message: string, data?: unknown): void; /** * Log a fatal error message */ fatal(message: string, data?: unknown): void; /** * Main logging method with level filtering * * @param level - Log level * @param message - Log message * @param data - Additional data to log */ log(level: LogLevel, message: string, data?: unknown): void; /** * Updates the logger configuration */ configure(options: Partial): void; /** * Gets the current log level */ getLogLevel(): LogLevel; /** * Sets the log level */ setLogLevel(level: LogLevel): void; /** * Checks if a log level would be output */ isLevelEnabled(level: LogLevel): boolean; /** * Internal method to handle log output * * @param level - Log level string (info, error, warn, debug) * @param message - Log message * @param data - Additional data to log */ private outputLog; /** * Formats a text message with optional timestamp and component name */ private formatTextMessage; /** * Colorizes a message based on log level */ private colorizeMessage; /** * Outputs message to appropriate console method based on level */ private outputToConsole; } /** * Factory function to create a shared logger instance * * @param options - Configuration options for the logger * @returns A new SharedLogger instance * * @example * ```typescript * const logger = createSharedLogger({ * logLevel: LogLevel.DEBUG, * format: 'text', * useColors: true, * componentName: 'my-component' * }); * ``` */ declare function createSharedLogger(options?: Partial): SharedLogger; /** * @fileoverview Metrics Middleware Implementation * * This module provides metrics collection middleware for performance monitoring, * usage tracking, and operational insights. * * @author Solomon AI Engineering Team * @version 1.0.0 */ /** * Interface for metrics collection backends */ interface MetricsCollector { /** Record a timing metric */ timing(name: string, value: number, tags?: Record): void; /** Increment a counter metric */ increment(name: string, value?: number, tags?: Record): void; /** Record a gauge metric */ gauge(name: string, value: number, tags?: Record): void; } /** * Configuration options for the metrics middleware */ interface MetricsOptions { /** Custom metrics collector */ collector?: MetricsCollector; /** Whether to collect timing metrics */ collectTiming?: boolean; /** Whether to collect error metrics */ collectErrors?: boolean; /** Custom tags to add to all metrics */ defaultTags?: Record; /** OpenTelemetry meter for standardized metrics */ otelMeter?: Meter; /** Enable OpenTelemetry integration */ enableOTel?: boolean; /** Service name for OpenTelemetry metrics */ serviceName?: string; /** Service version for OpenTelemetry metrics */ serviceVersion?: string; /** OpenTelemetry export endpoint (OTLP/HTTP) */ otelExportEndpoint?: string; /** OpenTelemetry export headers for authentication */ otelExportHeaders?: Record; /** OpenTelemetry export timeout in milliseconds */ otelExportTimeout?: number; /** OpenTelemetry export protocol (http/protobuf or http/json) */ otelExportProtocol?: "http/protobuf" | "http/json"; } /** * Creates a metrics collection middleware instance. * * This middleware collects performance and usage metrics including * request counts, response times, error rates, and custom metrics. * * @param options - Metrics configuration options * @returns Configured metrics middleware * * @example Basic Usage * ```typescript * const metricsMiddleware = createMetricsMiddleware({ * collectTiming: true, * collectErrors: true, * defaultTags: { service: 'fwb-client', version: '1.0.0' }, * collector: new CustomMetricsCollector() * }); * ``` * * @example With OpenTelemetry and Export Configuration * ```typescript * import { metrics } from '@opentelemetry/api'; * * const metricsMiddleware = createMetricsMiddleware({ * enableOTel: true, * otelMeter: metrics.getMeter('fwb-client', '1.0.0'), * serviceName: 'my-service', * otelExportEndpoint: 'https://otlp.example.com/v1/metrics', * otelExportHeaders: { * 'Authorization': 'Bearer your-api-key', * 'X-Scope-OrgID': 'tenant-123' * }, * otelExportTimeout: 10000, * otelExportProtocol: 'http/json', * collectTiming: true, * collectErrors: true * }); * ``` */ declare function createMetricsMiddleware(options?: MetricsOptions): Middleware; /** * @fileoverview Metrics Plugin Implementation with OpenTelemetry Integration * * This module provides metrics collection plugin that adds performance monitoring * capabilities to the Financial Workspace Backend Client with OpenTelemetry support. * * @author Solomon AI Engineering Team * @version 1.0.0 */ type OTelMeter = Meter; /** * Helper function to get OpenTelemetry meter if available * * @param serviceName - Service name for the meter * @param serviceVersion - Service version for the meter * @returns OpenTelemetry meter instance or null if not available * * @example * ```typescript * import { getOTelMeter } from '@solomonai/fwb-client/plugins'; * * const meter = getOTelMeter('my-service', '1.0.0'); * if (meter) { * // OpenTelemetry is available * const counter = meter.createCounter('requests_total'); * } * ``` */ declare function getOTelMeter(serviceName: string, serviceVersion: string): OTelMeter | null; /** * Zod schema for metrics plugin options */ declare const MetricsPluginOptionsSchema: z.ZodObject<{ /** Custom metrics collector */ collector: z.ZodOptional>; /** Enable request/response timing */ enableTiming: z.ZodDefault; /** Enable error tracking */ enableErrorTracking: z.ZodDefault; /** Custom metric tags */ defaultTags: z.ZodDefault>; /** Endpoint for sending metrics */ metricsEndpoint: z.ZodOptional; /** How often to flush metrics (in ms) */ flushInterval: z.ZodDefault; /** OpenTelemetry meter instance for standardized metrics */ otelMeter: z.ZodOptional>; /** Service name for OpenTelemetry metrics */ serviceName: z.ZodDefault; /** Service version for OpenTelemetry metrics */ serviceVersion: z.ZodDefault; /** Enable OpenTelemetry integration */ enableOTel: z.ZodDefault; /** OpenTelemetry export endpoint (OTLP/HTTP) */ otelExportEndpoint: z.ZodOptional; /** OpenTelemetry export headers for authentication */ otelExportHeaders: z.ZodOptional>; /** OpenTelemetry export timeout in milliseconds */ otelExportTimeout: z.ZodDefault; /** OpenTelemetry export protocol (http/protobuf or http/json) */ otelExportProtocol: z.ZodDefault>; }, "strict", z.ZodTypeAny, { defaultTags: Record; enableOTel: boolean; serviceName: string; serviceVersion: string; enableTiming: boolean; enableErrorTracking: boolean; flushInterval: number; otelExportTimeout: number; otelExportProtocol: "http/protobuf" | "http/json"; collector?: MetricsCollector | undefined; otelMeter?: Meter | undefined; metricsEndpoint?: string | undefined; otelExportEndpoint?: string | undefined; otelExportHeaders?: Record | undefined; }, { defaultTags?: Record | undefined; collector?: MetricsCollector | undefined; otelMeter?: Meter | undefined; enableOTel?: boolean | undefined; serviceName?: string | undefined; serviceVersion?: string | undefined; enableTiming?: boolean | undefined; enableErrorTracking?: boolean | undefined; metricsEndpoint?: string | undefined; flushInterval?: number | undefined; otelExportEndpoint?: string | undefined; otelExportHeaders?: Record | undefined; otelExportTimeout?: number | undefined; otelExportProtocol?: "http/protobuf" | "http/json" | undefined; }>; /** * Configuration options for the metrics plugin */ type MetricsPluginOptions = z.infer; /** * Metrics collection plugin that adds performance monitoring capabilities * * This plugin collects various metrics about API usage including: * - Request/response timing * - Error rates and types * - Usage patterns * - Performance metrics * * @example Basic Usage * ```typescript * import { MetricsPlugin } from '@solomonai/fwb-client/plugins'; * * const client = new FinancialWorkspaceBackendClient({ * rootKey: 'fwb_123', * plugins: [{ * plugin: new MetricsPlugin(), * options: { * enableTiming: true, * enableErrorTracking: true, * metricsEndpoint: 'https://metrics.example.com/api/metrics', * flushInterval: 30000 // 30 seconds * } * }] * }); * ``` * * @example OpenTelemetry Integration * ```typescript * import { metrics } from '@opentelemetry/api'; * import { MetricsPlugin } from '@solomonai/fwb-client/plugins'; * * // Get the global meter * const meter = metrics.getMeter('fwb-client', '1.0.0'); * * const client = new FinancialWorkspaceBackendClient({ * rootKey: 'fwb_123', * plugins: [{ * plugin: new MetricsPlugin(), * options: { * enableOTel: true, * otelMeter: meter, * serviceName: 'my-financial-app', * serviceVersion: '2.1.0', * otelExportEndpoint: 'https://otlp.example.com/v1/metrics', * otelExportHeaders: { * 'Authorization': 'Bearer your-token-here', * 'X-Custom-Header': 'value' * }, * otelExportTimeout: 15000, * otelExportProtocol: 'http/json', * enableTiming: true, * enableErrorTracking: true * } * }] * }); * ``` */ declare class MetricsPlugin implements Plugin { name: string; version: string; description: string; private metricsCollector?; private flushTimer?; private metricBuffer; private otelMeter?; private otelCounters; private otelHistograms; private otelGauges; private serviceName; private serviceVersion; initialize(_client: unknown, options?: Record): Promise; destroy(): Promise; getMiddleware(): Middleware[]; getClientExtensions(): Record; private bufferMetric; private flushMetrics; /** * Initializes OpenTelemetry instruments for common metrics */ private initializeOTelInstruments; /** * Records a value to an OpenTelemetry histogram */ private recordOTelHistogram; /** * Records a value to an OpenTelemetry counter */ private recordOTelCounter; /** * Records a value to an OpenTelemetry gauge (UpDownCounter) */ private recordOTelGauge; /** * Builds OpenTelemetry attributes from tags, adding service metadata */ private buildOTelAttributes; } /** * Factory function to create a metrics plugin instance * * @param options - Configuration options for the metrics plugin * @returns A new MetricsPlugin instance * * @example Basic Usage * ```typescript * const metricsPlugin = createMetricsPlugin({ * enableTiming: true, * metricsEndpoint: 'https://metrics.example.com/api/metrics' * }); * ``` * * @example With OpenTelemetry and Export Configuration * ```typescript * import { metrics } from '@opentelemetry/api'; * * const metricsPlugin = createMetricsPlugin({ * enableOTel: true, * otelMeter: metrics.getMeter('fwb-client'), * serviceName: 'my-service', * otelExportEndpoint: 'https://otlp.example.com/v1/metrics', * otelExportHeaders: { * 'Authorization': 'Bearer your-api-key' * }, * otelExportTimeout: 15000, * otelExportProtocol: 'http/json', * enableTiming: true, * enableErrorTracking: true * }); * ``` */ declare function createMetricsPlugin(_options?: MetricsPluginOptions): MetricsPlugin; /** * @fileoverview Logger Plugin Implementation * * This module provides advanced logging plugin with customizable formatting * and output options for the Financial Workspace Backend Client. * * @author Solomon AI Engineering Team * @version 1.0.0 */ /** * Zod schema for logger plugin options */ declare const LoggerPluginOptionsSchema: z.ZodObject<{ format: z.ZodDefault>; logLevel: z.ZodDefault>; customFormatter: z.ZodOptional, z.ZodString>>; useColors: z.ZodDefault; includeTimestamp: z.ZodDefault; includeComponentName: z.ZodDefault; componentName: z.ZodDefault; } & { /** Log file path (Node.js only) */ logFile: z.ZodOptional; /** Whether to include stack traces in error logs */ includeStackTrace: z.ZodDefault; /** Whether to log requests */ logRequests: z.ZodDefault; /** Whether to log responses */ logResponses: z.ZodDefault; /** Whether to log errors */ logErrors: z.ZodDefault; /** Whether to log response bodies (may contain sensitive data) */ logResponseBodies: z.ZodDefault; /** Custom logger function */ logger: z.ZodOptional], z.ZodUnknown>, z.ZodVoid>>; }, "strict", z.ZodTypeAny, { format: "json" | "text" | "custom"; logLevel: LogLevel; useColors: boolean; includeTimestamp: boolean; includeComponentName: boolean; componentName: string; logRequests: boolean; logResponses: boolean; logErrors: boolean; logResponseBodies: boolean; includeStackTrace: boolean; customFormatter?: ((args_0: any, ...args: unknown[]) => string) | undefined; logger?: ((args_0: string, args_1: string, args_2: unknown, ...args: unknown[]) => void) | undefined; logFile?: string | undefined; }, { format?: "json" | "text" | "custom" | undefined; logLevel?: LogLevel | undefined; customFormatter?: ((args_0: any, ...args: unknown[]) => string) | undefined; useColors?: boolean | undefined; includeTimestamp?: boolean | undefined; includeComponentName?: boolean | undefined; componentName?: string | undefined; logRequests?: boolean | undefined; logResponses?: boolean | undefined; logErrors?: boolean | undefined; logResponseBodies?: boolean | undefined; logger?: ((args_0: string, args_1: string, args_2: unknown, ...args: unknown[]) => void) | undefined; logFile?: string | undefined; includeStackTrace?: boolean | undefined; }>; /** * Configuration options for the logger plugin */ type LoggerPluginOptions = z.infer; /** * Advanced request/response logger plugin with customizable formatting * * This plugin provides comprehensive logging capabilities including: * - Request/response logging with customizable formats * - Error logging with stack traces * - Performance timing information * - Custom log formatting and output destinations * * @example Basic Usage * ```typescript * import { LoggerPlugin, LogLevel } from '@solomonai/fwb-client/plugins'; * * const client = new FinancialWorkspaceBackendClient({ * rootKey: 'fwb_123', * plugins: [{ * plugin: new LoggerPlugin(), * options: { * format: 'json', * logLevel: LogLevel.DEBUG, * logRequests: true, * logResponses: true, * logErrors: true, * includeStackTrace: true, * useColors: true * } * }] * }); * ``` * * @example Production Configuration * ```typescript * import { LoggerPlugin, LogLevel } from '@solomonai/fwb-client/plugins'; * * const client = new FinancialWorkspaceBackendClient({ * rootKey: 'fwb_123', * plugins: [{ * plugin: new LoggerPlugin(), * options: { * format: 'json', * logLevel: LogLevel.WARN, // Only log warnings and errors * logRequests: false, * logResponses: false, * logErrors: true, * logResponseBodies: false, * useColors: false, * includeTimestamp: true * } * }] * }); * ``` */ declare class LoggerPlugin implements Plugin { name: string; version: string; description: string; private options; private sharedLogger; initialize(_client: unknown, options?: Record): Promise; getMiddleware(): Middleware[]; /** * Main logging method with level filtering * * @param level - Log level * @param message - Log message * @param data - Additional data to log */ log(level: LogLevel, message: string, data?: unknown): void; /** * Convenience methods for different log levels */ trace(message: string, data?: unknown): void; debug(message: string, data?: unknown): void; info(message: string, data?: unknown): void; warn(message: string, data?: unknown): void; error(message: string, data?: unknown): void; fatal(message: string, data?: unknown): void; /** * Custom logger function that delegates to the shared logger * * @param level - Log level (info, error, warn, debug) * @param message - Log message * @param data - Additional data to log */ private customLogger; } /** * Factory function to create a logger plugin instance * * @param options - Configuration options for the logger plugin * @returns A new LoggerPlugin instance * * @example Basic Configuration * ```typescript * const loggerPlugin = createLoggerPlugin({ * format: 'text', * logLevel: LogLevel.DEBUG, * logRequests: true, * logResponses: false, * useColors: true, * includeTimestamp: true * }); * ``` * * @example Production Configuration * ```typescript * const loggerPlugin = createLoggerPlugin({ * format: 'json', * logLevel: LogLevel.WARN, * logRequests: false, * logResponses: false, * logErrors: true, * useColors: false, * includeTimestamp: true, * includeComponentName: false * }); * ``` */ declare function createLoggerPlugin(_options?: LoggerPluginOptions): LoggerPlugin; export { type Account, type AccountBalance, type AiAnalyticsResult, type AiBusinessPurposeBulkResult, type AiBusinessPurposeSingleResult, type AiCategorizeResult, type AiDetailedEnrichmentResult, type AiEnrichResult, type AiMultiModelResult, type AiPerDiemBulkResult, type AiPerDiemSingleResult, type AiReceiptRequirementBulkResult, type AiReceiptRequirementSingleResult, type AiTaxCategoryBulkResult, type AiTaxCategorySingleResult, type AiTaxDeductionBulkResult, type AiTaxDeductionSingleResult, type AiWorkerClassificationBulkResult, type AiWorkerClassificationSingleResult, type AnalyticsGetVerificationsResult, type Api, ApiBuilder, type ApiCreateResult, type ApiDeleteKeysResult, type ApiDeleteResult, type ApiGetResult, type ApiListKeysResult, type BusinessPurposeResult, type CategoryPredictionResult, type ClientOptions, type Connection, type ConnectionAccountBalanceResult, type ConnectionAccountsResult, type ConnectionDeleteResult, type ConnectionGetResult, type ConnectionGoCardlessResult, type ConnectionInfoSchema, type ConnectionStatusResult, type CreateKeyResult, type DetailedEnrichmentResult, type EnableBankingExchangeResult, type EnableBankingLinkResult, type EnrichmentResult, type ErrorResponse, type ExtractData, type ExtractError, FinancialWorkspaceBackendClient, type GoCardlessAgreementData, type GoCardlessAgreementResult, type GoCardlessExchangeResult, type GoCardlessLinkData, type GoCardlessLinkResult, type HealthCheck, type HealthCheckResponse, type HealthResult, type Identity, type IdentityCreateResult, type IdentityDeleteResult, type IdentityGetResult, type IdentityListResult, type IdentityUpdateResult, type Institution, type InstitutionSchema, type InstitutionUsageResult, type InstitutionsResult, type Key, type KeyAddPermissionsResult, type KeyAddRolesResult, KeyBuilder, type KeyCreateResult, type KeyDeleteResult, type KeyGetResult, type KeyGetVerificationsResult, type KeyRemovePermissionsResult, type KeyRemoveRolesResult, type KeySetPermissionsResult, type KeySetRolesResult, type KeyUpdateRemainingResult, type KeyUpdateResult, KeyVerificationBuilder, type KeyVerifyResult, type KeyWhoamiResult, type LegacyKeyCreateResult, type LegacyKeyListResult, type LegacyKeyVerifyResult, type LivenessCheckResult, LogLevel, LoggerPlugin, type LoggerPluginOptions, LoggerPluginOptionsSchema, type MetricsCollector, type MetricsOptions, MetricsPlugin, type MetricsPluginOptions, MetricsPluginOptionsSchema, type MigrationCreateKeysResult, type MigrationEnqueueKeysResult, type MultiModelEnrichmentResult, type PerDiemResult, type Permission, PermissionBuilder, type PermissionCreateResult, type PermissionDeleteResult, type PermissionGetResult, type PermissionListResult, type PlaidExchangeData, type PlaidExchangeResult, type PlaidLinkData, type PlaidLinkResult, type Rate, type RateLimitDeleteOverrideResult, type RateLimitGetOverrideResult, type RateLimitListOverridesResult, type RateLimitResult, type RateLimitSetOverrideResult, type RatesResult, type ReceiptRequirementResult, type RecurringTransaction, type RecurringTransactionInflow, type RecurringTransactionOutflow, type RecurringTransactionsResult, type Result$1 as Result, type Role, RoleBuilder, type RoleCreateResult, type RoleDeleteResult, type RoleGetResult, type RoleListResult, SharedLogger, type SharedLoggerOptions, SharedLoggerOptionsSchema, SolomonAIWorkspaceEngineSdk, type Statement, type StatementsPdfResult, type StatementsResult, type TaxCategoryResult, type TaxDeductionResult, type Transaction, type TransactionSchema, type TransactionsResult, type WorkerClassificationResult, createLoggerPlugin, createMetricsMiddleware, createMetricsPlugin, createSharedLogger, getOTelMeter, verifyKey };