# InsForge Docs: Traditional Chinese API 參考

## API 參考

### Tables

#### Admin

- [List Tables](https://docs.insforge.dev/api-reference/admin/list-tables.md)
- [Create Table](https://docs.insforge.dev/api-reference/admin/create-table.md)
- [Get Table Schema](https://docs.insforge.dev/api-reference/admin/get-table-schema.md)
- [Update Table Schema](https://docs.insforge.dev/api-reference/admin/update-table-schema.md)
- [Delete Table](https://docs.insforge.dev/api-reference/admin/delete-table.md)
- [List Database Migrations](https://docs.insforge.dev/api-reference/admin/list-database-migrations.md)
- [Create and Execute Database Migration](https://docs.insforge.dev/api-reference/admin/create-and-execute-database-migration.md)

### Schedules

#### Admin

- [List schedules](https://docs.insforge.dev/api-reference/admin/list-schedules.md): Returns all schedules configured in the system.
- [Create schedule](https://docs.insforge.dev/api-reference/admin/create-schedule.md): Creates a new scheduled job.
- [Get schedules configuration](https://docs.insforge.dev/api-reference/admin/get-schedules-configuration.md): Returns schedule retention configuration.
- [Update schedules configuration](https://docs.insforge.dev/api-reference/admin/update-schedules-configuration.md): Updates schedule retention configuration.
- [Get schedule by ID](https://docs.insforge.dev/api-reference/admin/get-schedule-by-id.md): Returns a single schedule by identifier.
- [Delete schedule](https://docs.insforge.dev/api-reference/admin/delete-schedule.md): Deletes a schedule.
- [Update schedule](https://docs.insforge.dev/api-reference/admin/update-schedule.md): Updates an existing schedule.
- [Get execution logs for a schedule](https://docs.insforge.dev/api-reference/admin/get-execution-logs-for-a-schedule.md): Returns execution history for a schedule with pagination support.

### 身分驗證

#### Client

- [Get public authentication configuration](https://docs.insforge.dev/api-reference/client/get-public-authentication-configuration.md): Get all public authentication configuration including OAuth providers and email auth settings (public endpoint)
- [Update current user's profile](https://docs.insforge.dev/api-reference/client/update-current-users-profile.md): Update the profile of the currently authenticated user
- [Get user profile by ID](https://docs.insforge.dev/api-reference/client/get-user-profile-by-id.md): Get public profile information for a user by their ID (public endpoint)
- [Register new user](https://docs.insforge.dev/api-reference/client/register-new-user.md): Creates a new user account. When email verification is required, a delivery failure is returned as an error after the account is created. Retry delivery with POST /api/auth/email/send-verification instead of registering the same email again.
- [User login](https://docs.insforge.dev/api-reference/client/user-login.md): Authenticates with a password or email OTP and returns an access token. Existing password clients may omit `method`; it defaults to `password`.
- [Refresh access token](https://docs.insforge.dev/api-reference/client/refresh-access-token.md): Refresh access token using refresh token. - Web clients: Use httpOnly refresh token cookie with X-CSRF-Token header - Mobile/Desktop/Server clients: Send refreshToken in request body
- [Logout user](https://docs.insforge.dev/api-reference/client/logout-user.md): Logout the current client session.
- [Get current session](https://docs.insforge.dev/api-reference/client/get-current-session.md): Returns the currently authenticated user's basic info from the access token. Project admin tokens return a projectAdmin session object instead of an auth.users row.
- [Send an email sign-in OTP](https://docs.insforge.dev/api-reference/client/send-an-email-sign-in-otp.md): Sends a 6-digit code that can be exchanged at POST /api/auth/sessions with `method: otp`. The response is intentionally generic and does not reveal whether a user already exists. The code expires after 5 minutes.
- [Send email verification (code or link based on config)](https://docs.insforge.dev/api-reference/client/send-email-verification-code-or-link-based-on-config.md): Send email verification using the method configured in auth settings (verifyEmailMethod). When method is 'code', sends a 6-digit numeric code. When method is 'link', sends a browser verification link that goes through an InsForge backend endpoint first. Prevents user enumeration by returning success…
- [Verify email from browser link click](https://docs.insforge.dev/api-reference/client/verify-email-from-browser-link-click.md): Browser-oriented link verification flow.
- [Verify email with code](https://docs.insforge.dev/api-reference/client/verify-email-with-code.md): Verify email address with a 6-digit code.
- [Send password reset (code or link based on config)](https://docs.insforge.dev/api-reference/client/send-password-reset-code-or-link-based-on-config.md): Send password reset email using the method configured in auth settings (resetPasswordMethod). When method is 'code', sends a 6-digit numeric code for two-step flow. When method is 'link', sends a browser reset link that goes through an InsForge backend endpoint first. Prevents user enumeration by re…
- [Exchange reset password code for reset token](https://docs.insforge.dev/api-reference/client/exchange-reset-password-code-for-reset-token.md): Step 1 of two-step password reset flow (only used when resetPasswordMethod is 'code'): 1. Verify the 6-digit code sent to user's email 2. Return a reset token that can be used to actually reset the password
- [Open password reset flow from browser link click](https://docs.insforge.dev/api-reference/client/open-password-reset-flow-from-browser-link-click.md): Browser-oriented password reset link flow.
- [Reset password with token](https://docs.insforge.dev/api-reference/client/reset-password-with-token.md): Reset user password with a token. The token can be: - Magic link token (64-character hex token from send-reset-password when method is 'link') - Reset token (from exchange-reset-password-token after code verification when method is 'code')
- [Initiate OAuth flow (PKCE)](https://docs.insforge.dev/api-reference/client/initiate-oauth-flow-pkce.md): Generate OAuth authorization URL for any supported provider using PKCE flow.
- [Exchange OAuth code for tokens (PKCE)](https://docs.insforge.dev/api-reference/client/exchange-oauth-code-for-tokens-pkce.md): Exchange the insforge_code (received from OAuth callback) for access and refresh tokens.
- [Shared OAuth callback handler](https://docs.insforge.dev/api-reference/client/shared-oauth-callback-handler.md): Handles OAuth callbacks from InsForge Cloud shared OAuth
- [Provider-specific OAuth callback (GET)](https://docs.insforge.dev/api-reference/client/provider-specific-oauth-callback-get.md): OAuth callback endpoint for provider-specific flows (most providers use GET).
- [Provider-specific OAuth callback (POST)](https://docs.insforge.dev/api-reference/client/provider-specific-oauth-callback-post.md): OAuth callback endpoint for providers that use POST (e.g., Apple with form_post response mode).
- [Initiate custom OAuth flow (PKCE)](https://docs.insforge.dev/api-reference/client/initiate-custom-oauth-flow-pkce.md): Generate OAuth authorization URL for a configured custom OAuth provider using PKCE flow
- [Custom OAuth callback (GET)](https://docs.insforge.dev/api-reference/client/custom-oauth-callback-get.md): OAuth callback endpoint for custom OAuth providers
- [Sign in with a native provider ID token](https://docs.insforge.dev/api-reference/client/sign-in-with-a-native-provider-id-token.md): Authenticate a user using an ID token obtained from Google or Apple's native SDK. Apple requests require the original raw nonce whose lowercase SHA-256 hex digest was attached to the native authorization request. Apple token audiences are validated only against the project's configured clientId and…

#### Admin

- [Get authentication configuration](https://docs.insforge.dev/api-reference/admin/get-authentication-configuration.md): Get current authentication settings including all configuration options (admin only)
- [Update authentication configuration](https://docs.insforge.dev/api-reference/admin/update-authentication-configuration.md): Update authentication settings (admin only)
- [List all users (admin only)](https://docs.insforge.dev/api-reference/admin/list-all-users-admin-only.md): Returns paginated list of users
- [Delete users (admin only)](https://docs.insforge.dev/api-reference/admin/delete-users-admin-only.md): Delete multiple users by their IDs
- [Get specific user](https://docs.insforge.dev/api-reference/admin/get-specific-user.md): Get user details by ID (admin only)
- [Admin login](https://docs.insforge.dev/api-reference/admin/admin-login.md): Authenticates admin user for dashboard access
- [Exchange cloud provider authorization code for admin session](https://docs.insforge.dev/api-reference/admin/exchange-cloud-provider-authorization-code-for-admin-session.md): Verifies an authorization code/JWT from from Insforge Cloud platform and issues an internal admin session token with project_admin role
- [Refresh admin dashboard access token](https://docs.insforge.dev/api-reference/admin/refresh-admin-dashboard-access-token.md): Uses the dashboard-only httpOnly `insforge_admin_refresh_token` cookie with an `X-CSRF-Token` header.
- [Logout admin dashboard session](https://docs.insforge.dev/api-reference/admin/logout-admin-dashboard-session.md): Clears the dashboard-only `insforge_admin_refresh_token` cookie.
- [Get anon key (deprecated)](https://docs.insforge.dev/api-reference/admin/get-anon-key-deprecated.md): Deprecated - use GET /api/metadata/anon-key instead. Returns the project's opaque anon key (`anon_...`) under the legacy `accessToken` field for backward compatibility. The anon key is a non-secret client identifier that maps requests to the `anon` role; it replaces the former non-expiring anonymous…
- [List all OAuth configurations](https://docs.insforge.dev/api-reference/admin/list-all-oauth-configurations.md): Get all configured OAuth providers (admin only)
- [Create OAuth configuration](https://docs.insforge.dev/api-reference/admin/create-oauth-configuration.md): Create a new OAuth provider configuration (admin only)
- [Get OAuth configuration for specific provider](https://docs.insforge.dev/api-reference/admin/get-oauth-configuration-for-specific-provider.md): Get OAuth configuration including client secret (admin only)
- [Update OAuth configuration](https://docs.insforge.dev/api-reference/admin/update-oauth-configuration.md): Update OAuth provider configuration (admin only)
- [Delete OAuth configuration](https://docs.insforge.dev/api-reference/admin/delete-oauth-configuration.md): Delete OAuth provider configuration (admin only)
- [List all custom OAuth configurations](https://docs.insforge.dev/api-reference/admin/list-all-custom-oauth-configurations.md): Get all configured custom OAuth providers (admin only)
- [Create custom OAuth configuration](https://docs.insforge.dev/api-reference/admin/create-custom-oauth-configuration.md): Create a new custom OAuth provider configuration (admin only)
- [Get custom OAuth configuration](https://docs.insforge.dev/api-reference/admin/get-custom-oauth-configuration.md): Get a custom OAuth configuration including client secret (admin only)
- [Update custom OAuth configuration](https://docs.insforge.dev/api-reference/admin/update-custom-oauth-configuration.md): Update a custom OAuth provider configuration (admin only)
- [Delete custom OAuth configuration](https://docs.insforge.dev/api-reference/admin/delete-custom-oauth-configuration.md): Delete a custom OAuth provider configuration (admin only)
- [Get current admin session](https://docs.insforge.dev/api-reference/admin/get-current-admin-session.md): Returns the currently authenticated admin's basic info from the access token.
- [Get SMTP configuration](https://docs.insforge.dev/api-reference/admin/get-smtp-configuration.md): Get current SMTP email configuration (admin only)
- [Update SMTP configuration](https://docs.insforge.dev/api-reference/admin/update-smtp-configuration.md): Create or update SMTP email configuration (admin only). When `enabled` is true, the fields `host`, `username`, `senderEmail`, and `senderName` are required by the backend validation. When `enabled` is false, these fields may be empty. SMTP cannot be disabled on a self-hosted instance while email ver…
- [Get all email templates](https://docs.insforge.dev/api-reference/admin/get-all-email-templates.md): Returns all configurable email templates (admin only)
- [Update email template](https://docs.insforge.dev/api-reference/admin/update-email-template.md): Update a specific email template by type (admin only)

### Records

#### Client

- [Query Records](https://docs.insforge.dev/api-reference/client/query-records.md): Query records from a table with filtering, sorting, and pagination
- [Create Records](https://docs.insforge.dev/api-reference/client/create-records.md): Create one or more records. Request body MUST be an array.
- [Delete Records](https://docs.insforge.dev/api-reference/client/delete-records.md): Delete records matching query filters
- [Update Records](https://docs.insforge.dev/api-reference/client/update-records.md): Update records matching query filters

### 儲存

#### Admin

- [Get storage configuration](https://docs.insforge.dev/api-reference/admin/get-storage-configuration.md): Returns the current storage configuration including file size limits (admin only)
- [Update storage configuration](https://docs.insforge.dev/api-reference/admin/update-storage-configuration.md): Update storage settings such as maximum file size (admin only)
- [List All Buckets](https://docs.insforge.dev/api-reference/admin/list-all-buckets.md)
- [Create New Bucket](https://docs.insforge.dev/api-reference/admin/create-new-bucket.md)
- [Delete Bucket](https://docs.insforge.dev/api-reference/admin/delete-bucket.md): Delete an entire bucket and all its objects
- [Update Bucket](https://docs.insforge.dev/api-reference/admin/update-bucket.md)
- [List Objects in Bucket](https://docs.insforge.dev/api-reference/admin/list-objects-in-bucket.md)

#### Client

- [Upload Object with Auto-Generated Key](https://docs.insforge.dev/api-reference/client/upload-object-with-auto-generated-key.md)
- [Delete Multiple Objects](https://docs.insforge.dev/api-reference/client/delete-multiple-objects.md): Deletes up to 1000 objects from a bucket for the authenticated caller. Object row deletion is authorized through storage RLS, and the response reports per-key outcomes for rows deleted from the database, keys not visible or missing, and provider-level failures.
- [Get Upload Strategy (Direct or Presigned URL)](https://docs.insforge.dev/api-reference/client/get-upload-strategy-direct-or-presigned-url.md): Returns the upload strategy for the requested object. Local storage always returns direct upload endpoints. S3 storage may return either `presigned` or `direct` strategies depending on the `S3_USE_PRESIGNED_URLS` configuration. Clients must determine the upload flow from the returned response, using…
- [Download Object](https://docs.insforge.dev/api-reference/client/download-object.md)
- [Upload Object](https://docs.insforge.dev/api-reference/client/upload-object.md): Creates or replaces the object at the exact key, matching S3 PutObject semantics. End-user creates and replacements are gated by the `storage.objects` row-level-security policies; replacing an object never reassigns its ownership.
- [Delete Object](https://docs.insforge.dev/api-reference/client/delete-object.md)
- [Confirm Presigned Upload](https://docs.insforge.dev/api-reference/client/confirm-presigned-upload.md): Confirms that a file was successfully uploaded to S3 using presigned URL
- [Get Download Strategy (Direct or Presigned URL)](https://docs.insforge.dev/api-reference/client/get-download-strategy-direct-or-presigned-url.md): Returns the download strategy based on the storage backend, bucket visibility, and the `S3_USE_PRESIGNED_URLS` configuration.
- [Get Download Strategy (Deprecated — use GET on the canonical path)](https://docs.insforge.dev/api-reference/client/get-download-strategy-deprecated-—-use-get-on-the-canonical-path.md): Deprecated alias of `GET /api/storage/buckets/{bucketName}/download-strategy/objects/{objectKey}`. Retained at the original path/method for backward compatibility with SDK releases that already shipped against this POST endpoint. Any request body is ignored.

#### S3 Access Keys

- [Get S3 Gateway Config](https://docs.insforge.dev/api-reference/s3-access-keys/get-s3-gateway-config.md): Return the externally-reachable endpoint URL, the SigV4 signing region, and the availability of the S3 protocol gateway. The endpoint is assembled from the server's `VITE_API_BASE_URL` env var plus `/storage/v1/s3`; the region is `S3_REGION` (fallback `AWS_REGION`, default `us-east-2`); `available`…
- [List S3 Access Keys](https://docs.insforge.dev/api-reference/s3-access-keys/list-s3-access-keys.md): Return every S3 access key configured for this project. Plaintext secrets are **never** returned here — the secret is only shown once in the response of `POST /api/storage/s3/access-keys`.
- [Create S3 Access Key](https://docs.insforge.dev/api-reference/s3-access-keys/create-s3-access-key.md): Mint a new S3 credential pair usable against the `/storage/v1/s3` protocol gateway. The plaintext `secretAccessKey` in the response is returned **exactly once** — it is encrypted at rest and can never be retrieved again. If you lose it, revoke and re-create.
- [Revoke S3 Access Key](https://docs.insforge.dev/api-reference/s3-access-keys/revoke-s3-access-key.md): Revoke an S3 access key by its id. The in-memory LRU cache is invalidated synchronously so subsequent S3 protocol requests with this credential return `403 InvalidAccessKeyId`.

#### S3 Protocol

- [S3 protocol (GET)](https://docs.insforge.dev/api-reference/s3-protocol/s3-protocol-get.md): Dispatched to ListBuckets / ListObjectsV2 / GetObject / HeadObject / ListParts / GetBucketLocation / GetBucketVersioning based on path shape and query.
- [S3 protocol (PUT)](https://docs.insforge.dev/api-reference/s3-protocol/s3-protocol-put.md): Dispatched to PutObject / UploadPart / CopyObject / CreateBucket based on path shape, query, and headers.
- [S3 protocol (POST)](https://docs.insforge.dev/api-reference/s3-protocol/s3-protocol-post.md): Dispatched to CreateMultipartUpload / CompleteMultipartUpload / DeleteObjects based on query.
- [S3 protocol (DELETE)](https://docs.insforge.dev/api-reference/s3-protocol/s3-protocol-delete.md): Dispatched to DeleteObject / DeleteBucket / AbortMultipartUpload based on path and query.
- [S3 protocol (HEAD)](https://docs.insforge.dev/api-reference/s3-protocol/s3-protocol-head.md): Dispatched to HeadBucket / HeadObject based on path shape.

### 模型閘道

#### Admin

- [Get Model Gateway credential configuration](https://docs.insforge.dev/api-reference/admin/get-model-gateway-credential-configuration.md): Returns masked OpenRouter API and management key status for self-hosted deployments. Cloud-hosted credentials are managed by InsForge Cloud.
- [Update Model Gateway credentials](https://docs.insforge.dev/api-reference/admin/update-model-gateway-credentials.md): Stores one or both OpenRouter credentials as encrypted reserved secrets in a self-hosted deployment. Credentials are independent and may be updated separately.
- [Get all available AI models](https://docs.insforge.dev/api-reference/admin/get-all-available-ai-models.md): Returns the normalized OpenRouter model catalog fetched from OpenRouter with output_modalities=all.
- [Get Model Gateway overview](https://docs.insforge.dev/api-reference/admin/get-model-gateway-overview.md): Returns key-level OpenRouter usage and activity time series when the key has activity access.
- [Get active provider API key](https://docs.insforge.dev/api-reference/admin/get-active-provider-api-key.md): Returns the active provider API key details for admin copy workflows. Currently only `openrouter` is supported.
- [Rotate provider API key](https://docs.insforge.dev/api-reference/admin/rotate-provider-api-key.md): Rotate the active provider API key for cloud-managed Model Gateway credentials. Currently only `openrouter` is supported.

#### Client

- [Generate chat completion (deprecated)](https://docs.insforge.dev/api-reference/client/generate-chat-completion-deprecated.md): Deprecated compatibility proxy. New integrations should call https://openrouter.ai/api/v1/chat/completions directly with the provisioned OpenRouter key.
- [Generate images (deprecated)](https://docs.insforge.dev/api-reference/client/generate-images-deprecated.md): Deprecated compatibility proxy. New integrations should use OpenRouter image-capable models directly with the provisioned OpenRouter key.
- [Generate embeddings (deprecated)](https://docs.insforge.dev/api-reference/client/generate-embeddings-deprecated.md): Deprecated compatibility proxy. New integrations should call https://openrouter.ai/api/v1/embeddings directly with the provisioned OpenRouter key.

### Functions

#### Admin

- [List all functions](https://docs.insforge.dev/api-reference/admin/list-all-functions.md): Get all functions with their metadata
- [Create new function](https://docs.insforge.dev/api-reference/admin/create-new-function.md): Create a new function with code that runs in Deno runtime
- [Get function details](https://docs.insforge.dev/api-reference/admin/get-function-details.md): Get a specific function including its code
- [Update function](https://docs.insforge.dev/api-reference/admin/update-function.md): Update an existing function's code or metadata
- [Delete function](https://docs.insforge.dev/api-reference/admin/delete-function.md): Permanently delete a function

#### Client

- [Execute function (GET)](https://docs.insforge.dev/api-reference/client/execute-function-get.md): Execute a function using GET method. Proxied to Deno runtime.
- [Execute function (PUT)](https://docs.insforge.dev/api-reference/client/execute-function-put.md): Execute a function using PUT method. Proxied to Deno runtime.
- [Execute function (POST)](https://docs.insforge.dev/api-reference/client/execute-function-post.md): Execute a function using POST method with JSON body. Proxied to Deno runtime.
- [Execute function (DELETE)](https://docs.insforge.dev/api-reference/client/execute-function-delete.md): Execute a function using DELETE method. Proxied to Deno runtime.
- [Execute function (PATCH)](https://docs.insforge.dev/api-reference/client/execute-function-patch.md): Execute a function using PATCH method. Proxied to Deno runtime.

### 即時

#### Channels

- [List All Channels](https://docs.insforge.dev/api-reference/channels/list-all-channels.md): Retrieve all configured realtime channels
- [Create Channel](https://docs.insforge.dev/api-reference/channels/create-channel.md): Create a new realtime channel with a pattern for subscription matching
- [Get Channel by ID](https://docs.insforge.dev/api-reference/channels/get-channel-by-id.md): Retrieve a specific channel by its UUID
- [Update Channel](https://docs.insforge.dev/api-reference/channels/update-channel.md): Update an existing channel's configuration
- [Delete Channel](https://docs.insforge.dev/api-reference/channels/delete-channel.md): Delete a channel definition. Existing message history is preserved with null channelId values.

#### Messages

- [List Messages](https://docs.insforge.dev/api-reference/messages/list-messages.md): Retrieve message history with optional filters
- [Clear Messages](https://docs.insforge.dev/api-reference/messages/clear-messages.md): Permanently delete all stored realtime messages
- [Get Message Statistics](https://docs.insforge.dev/api-reference/messages/get-message-statistics.md): Retrieve aggregated statistics about messages

#### Permissions

- [Get Realtime Permissions](https://docs.insforge.dev/api-reference/permissions/get-realtime-permissions.md): Retrieve RLS policies for subscribe (channels) and publish (messages) operations

#### Configuration

- [Get Realtime Config](https://docs.insforge.dev/api-reference/configuration/get-realtime-config.md): Retrieve realtime message retention configuration
- [Update Realtime Config](https://docs.insforge.dev/api-reference/configuration/update-realtime-config.md): Update realtime message retention configuration

### 訊息

#### Client

- [Send raw HTML email](https://docs.insforge.dev/api-reference/client/send-raw-html-email.md): Send a custom HTML email to one or more recipients. Requires user authentication or a valid admin API key.

### 金流

#### Stripe Payments

- [Create Stripe Checkout Session](https://docs.insforge.dev/api-reference/stripe-payments/create-stripe-checkout-session.md): Create a local checkout attempt with the caller's user context and then create a Stripe Checkout Session. Subscription mode requires a billing subject.
- [Create Stripe Customer Portal Session](https://docs.insforge.dev/api-reference/stripe-payments/create-stripe-customer-portal-session.md): Create a Stripe Billing Portal Session for an authenticated user's mapped billing subject.
- [Get Stripe Payments Status](https://docs.insforge.dev/api-reference/stripe-payments/get-stripe-payments-status.md): Return Stripe connection, sync, and managed webhook status for each environment.
- [Get Stripe Key Configuration](https://docs.insforge.dev/api-reference/stripe-payments/get-stripe-key-configuration.md): Return masked Stripe key configuration for test and live environments.
- [Configure Stripe Secret Key](https://docs.insforge.dev/api-reference/stripe-payments/configure-stripe-secret-key.md): Validate and store a Stripe secret key. New Stripe accounts attempt managed webhook setup and then run a unified sync.
- [Remove Stripe Secret Key](https://docs.insforge.dev/api-reference/stripe-payments/remove-stripe-secret-key.md): Remove the configured Stripe secret key for one environment and best-effort remove managed webhook endpoints.
- [Sync Stripe Payments State](https://docs.insforge.dev/api-reference/stripe-payments/sync-stripe-payments-state.md): Sync products, prices, customers, and subscriptions for every configured Stripe environment. Stripe remains the source of truth.
- [Sync Stripe Payments State For One Environment](https://docs.insforge.dev/api-reference/stripe-payments/sync-stripe-payments-state-for-one-environment.md): Sync products, prices, customers, and subscriptions for one Stripe environment. Stripe remains the source of truth.
- [Configure Managed Stripe Webhook](https://docs.insforge.dev/api-reference/stripe-payments/configure-managed-stripe-webhook.md): Create or recreate the InsForge-managed Stripe webhook endpoint for one environment.
- [List Stripe Catalog](https://docs.insforge.dev/api-reference/stripe-payments/list-stripe-catalog.md): Return mirrored Stripe products and prices for one environment.
- [List Stripe Products](https://docs.insforge.dev/api-reference/stripe-payments/list-stripe-products.md): List mirrored Stripe products for one environment.
- [Create Stripe Product](https://docs.insforge.dev/api-reference/stripe-payments/create-stripe-product.md): Create a Stripe product in the requested environment, then mirror it locally after Stripe succeeds.
- [Get Stripe Product](https://docs.insforge.dev/api-reference/stripe-payments/get-stripe-product.md): Get one mirrored Stripe product and its associated prices.
- [Delete Stripe Product](https://docs.insforge.dev/api-reference/stripe-payments/delete-stripe-product.md): Delete a Stripe product from one environment, then remove it from the local mirror.
- [Update Stripe Product](https://docs.insforge.dev/api-reference/stripe-payments/update-stripe-product.md): Update a Stripe product, then mirror it locally after Stripe succeeds.
- [List Stripe Prices](https://docs.insforge.dev/api-reference/stripe-payments/list-stripe-prices.md): List mirrored Stripe prices for one environment, optionally filtered by product.
- [Create Stripe Price](https://docs.insforge.dev/api-reference/stripe-payments/create-stripe-price.md): Create a Stripe price in the requested environment, then mirror it locally after Stripe succeeds.
- [Get Stripe Price](https://docs.insforge.dev/api-reference/stripe-payments/get-stripe-price.md): Get one mirrored Stripe price.
- [Archive Stripe Price](https://docs.insforge.dev/api-reference/stripe-payments/archive-stripe-price.md): Archive a Stripe price in one environment, then mirror the archived state locally.
- [Update Stripe Price](https://docs.insforge.dev/api-reference/stripe-payments/update-stripe-price.md): Update mutable Stripe price fields, then mirror the price locally after Stripe succeeds.
- [List Stripe Subscriptions](https://docs.insforge.dev/api-reference/stripe-payments/list-stripe-subscriptions.md): Admin/debug read for mirrored Stripe subscriptions. Use app-owned tables with RLS for end-user payment state.
- [List Stripe Customers](https://docs.insforge.dev/api-reference/stripe-payments/list-stripe-customers.md): Admin/debug read for mirrored Stripe customers. This is a display mirror only and should not replace app-owned billing tables.
- [List Stripe Transactions](https://docs.insforge.dev/api-reference/stripe-payments/list-stripe-transactions.md): Admin/debug read for InsForge's Stripe transaction projection. Use app-owned fulfillment tables with RLS for end-user order, credit, or entitlement state.

#### Razorpay Payments

- [Get Razorpay Payments Status](https://docs.insforge.dev/api-reference/razorpay-payments/get-razorpay-payments-status.md): Return Razorpay connection and sync status for each environment.
- [Get Razorpay Key Configuration](https://docs.insforge.dev/api-reference/razorpay-payments/get-razorpay-key-configuration.md): Return masked Razorpay key configuration for test and live environments.
- [Sync Razorpay Payments State](https://docs.insforge.dev/api-reference/razorpay-payments/sync-razorpay-payments-state.md): Sync items, plans, customers, subscriptions, invoices, and payments for every configured Razorpay environment. Razorpay remains the source of truth.
- [Configure Razorpay Keys](https://docs.insforge.dev/api-reference/razorpay-payments/configure-razorpay-keys.md): Validate and store Razorpay API keys for one environment. A webhook secret is generated automatically when one does not already exist.
- [Remove Razorpay Keys](https://docs.insforge.dev/api-reference/razorpay-payments/remove-razorpay-keys.md): Remove the configured Razorpay keys for one environment.
- [Sync Razorpay Payments State For One Environment](https://docs.insforge.dev/api-reference/razorpay-payments/sync-razorpay-payments-state-for-one-environment.md): Sync items, plans, customers, subscriptions, invoices, and payments for one Razorpay environment. Razorpay remains the source of truth.
- [Get Razorpay Webhook Setup Values](https://docs.insforge.dev/api-reference/razorpay-payments/get-razorpay-webhook-setup-values.md): Return the Razorpay webhook URL and signing secret that must be copied into the Razorpay Dashboard for manual webhook setup.
- [Rotate Razorpay Webhook Secret](https://docs.insforge.dev/api-reference/razorpay-payments/rotate-razorpay-webhook-secret.md): Generate a new Razorpay webhook signing secret. Update the webhook secret in the Razorpay Dashboard after calling this endpoint.
- [Create Razorpay Order](https://docs.insforge.dev/api-reference/razorpay-payments/create-razorpay-order.md): Create a local Razorpay Order record with the caller's user context, create a Razorpay Order, and return Checkout options for the client-side Razorpay Checkout script.
- [Verify Razorpay Order Payment](https://docs.insforge.dev/api-reference/razorpay-payments/verify-razorpay-order-payment.md): Verify the Razorpay Checkout signature for an order payment before recording the verified payment ID locally.
- [List Razorpay Payment Catalog](https://docs.insforge.dev/api-reference/razorpay-payments/list-razorpay-payment-catalog.md): Return mirrored Razorpay items and plans for one environment.
- [Create Razorpay Item](https://docs.insforge.dev/api-reference/razorpay-payments/create-razorpay-item.md): Create a Razorpay Item, then mirror it locally after Razorpay succeeds.
- [Update Razorpay Item](https://docs.insforge.dev/api-reference/razorpay-payments/update-razorpay-item.md): Update mutable Razorpay Item fields, then mirror the item locally after Razorpay succeeds.
- [Create Razorpay Plan](https://docs.insforge.dev/api-reference/razorpay-payments/create-razorpay-plan.md): Create a Razorpay Plan with its amount-bearing item definition, then mirror it locally after Razorpay succeeds.
- [List Razorpay Subscriptions](https://docs.insforge.dev/api-reference/razorpay-payments/list-razorpay-subscriptions.md): Admin/debug read for mirrored Razorpay subscriptions. Use app-owned tables with RLS for end-user payment state.
- [Create Razorpay Subscription](https://docs.insforge.dev/api-reference/razorpay-payments/create-razorpay-subscription.md): Create a Razorpay Subscription and mirror it locally, then return Checkout options for authorization. The backend first evaluates the caller's INSERT policy on payments.razorpay_subscriptions so apps can restrict which subjects can start subscriptions.
- [Verify Razorpay Subscription Authorization](https://docs.insforge.dev/api-reference/razorpay-payments/verify-razorpay-subscription-authorization.md): Verify the Razorpay Checkout signature for the subscription authorization payment before recording the authorization payment ID locally.
- [Cancel Razorpay Subscription](https://docs.insforge.dev/api-reference/razorpay-payments/cancel-razorpay-subscription.md): Cancel a Razorpay subscription after evaluating the caller's UPDATE policy on payments.razorpay_subscriptions.
- [Pause Razorpay Subscription](https://docs.insforge.dev/api-reference/razorpay-payments/pause-razorpay-subscription.md): Pause a Razorpay subscription immediately after evaluating the caller's UPDATE policy on payments.razorpay_subscriptions.
- [Resume Razorpay Subscription](https://docs.insforge.dev/api-reference/razorpay-payments/resume-razorpay-subscription.md): Resume a paused Razorpay subscription immediately after evaluating the caller's UPDATE policy on payments.razorpay_subscriptions.
- [List Razorpay Customers](https://docs.insforge.dev/api-reference/razorpay-payments/list-razorpay-customers.md): Admin/debug read for mirrored Razorpay customers. This is a display mirror only and should not replace app-owned billing tables.
- [List Razorpay Transactions](https://docs.insforge.dev/api-reference/razorpay-payments/list-razorpay-transactions.md): Admin/debug read for InsForge's Razorpay transaction projection. Use app-owned fulfillment tables with RLS for end-user order, credit, or entitlement state.

#### Payment Webhooks

- [Receive Stripe Webhook](https://docs.insforge.dev/api-reference/payment-webhooks/receive-stripe-webhook.md): Receive Stripe events for one environment. The request body must be the raw Stripe JSON body and must include the Stripe signature header.
- [Receive Razorpay Webhook](https://docs.insforge.dev/api-reference/payment-webhooks/receive-razorpay-webhook.md): Receive Razorpay events for one environment. The request body must be the raw Razorpay JSON body and must include the Razorpay signature header.

### Secrets

#### Admin

- [List all secrets](https://docs.insforge.dev/api-reference/admin/list-all-secrets.md): Returns metadata for all secrets (without values)
- [Create a new secret](https://docs.insforge.dev/api-reference/admin/create-a-new-secret.md): Create a new encrypted secret with a unique key
- [Get secret value](https://docs.insforge.dev/api-reference/admin/get-secret-value.md): Retrieve the decrypted value of a specific secret by its key
- [Update secret](https://docs.insforge.dev/api-reference/admin/update-secret.md): Update an existing secret's value or metadata
- [Delete secret](https://docs.insforge.dev/api-reference/admin/delete-secret.md): Mark a secret as inactive (soft delete). Cannot delete reserved secrets.
- [Rotate API key](https://docs.insforge.dev/api-reference/admin/rotate-api-key.md): Rotate the project's admin API key. A new key is generated and returned; the old key stays valid for the grace period (default 24 hours, max 168 / 7 days) so in-flight requests finish gracefully. Admin only.
- [Rotate anon key](https://docs.insforge.dev/api-reference/admin/rotate-anon-key.md): Rotate the project's opaque anon key (`anon_...`). A new key is generated and returned; the old key stays valid for the grace period (default 168 hours / 7 days, max 720) so already-deployed frontends and mobile binaries keep working while the new key ships. Admin only.

### Logs

#### Admin

- [List audit logs](https://docs.insforge.dev/api-reference/admin/list-audit-logs.md): Paginated activity log. Responses use the PostgREST-style contract from `paginatedResponse`: `206 Partial Content` with a `Content-Range` header when the page is a subset, `200` when it returns everything.
- [Clear audit logs](https://docs.insforge.dev/api-reference/admin/clear-audit-logs.md): Retention-based cleanup. Deletes every audit log older than `days_to_keep` days and answers with `deleted`, the number of rows removed. There is no dry run, and the deletion is not reversible.
- [Get per-source log statistics](https://docs.insforge.dev/api-reference/admin/get-per-source-log-statistics.md): One entry per system log source. This is not the audit-log summary; that lives at `/api/logs/audits/stats`.
- [Get audit log summary](https://docs.insforge.dev/api-reference/admin/get-audit-log-summary.md): Aggregates the audit log over the last `days` days. `totalLogs`, `uniqueActors` and `uniqueModules` are counts across that window, `actionsByModule` is the per-module action count keyed by module name, and `recentActivity` carries the most recent entries in full.
- [List log sources](https://docs.insforge.dev/api-reference/admin/list-log-sources.md)
- [Search logs](https://docs.insforge.dev/api-reference/admin/search-logs.md): Paginates through `paginatedResponse`, so responses use 206 with `Content-Range` when the page is a subset and 200 when it is not.
- [Get function build logs](https://docs.insforge.dev/api-reference/admin/get-function-build-logs.md)
- [Get logs from one source](https://docs.insforge.dev/api-reference/admin/get-logs-from-one-source.md)

### Usage

#### Usage

- [List MCP usage records](https://docs.insforge.dev/api-reference/usage/list-mcp-usage-records.md): Returns recent MCP usage rows filtered by `success`.
- [Record MCP tool usage](https://docs.insforge.dev/api-reference/usage/record-mcp-tool-usage.md): Records an MCP tool invocation in `system.mcp_usage`. The `success` flag defaults to `true` when omitted.
- [Get usage statistics](https://docs.insforge.dev/api-reference/usage/get-usage-statistics.md): Returns usage statistics for the supplied date range. The `mcp_usage_count` field counts successful MCP usage records and is filtered by `start_date` and `end_date`, while `database_size_bytes`, `storage_size_bytes`, and `user_count` reflect the current system state. Both `start_date` and `end_date`…

### Metadata

#### Admin

- [Get app metadata](https://docs.insforge.dev/api-reference/admin/get-app-metadata.md): Returns aggregated application metadata (auth, database, storage, functions, realtime, deployments). Use the `format` query parameter to choose between JSON and Markdown output.
- [Get database metadata](https://docs.insforge.dev/api-reference/admin/get-database-metadata.md): Get database statistics and table information for dashboard
- [Get API key](https://docs.insforge.dev/api-reference/admin/get-api-key.md): Admin-only endpoint to retrieve the API key
- [Get anon key](https://docs.insforge.dev/api-reference/admin/get-anon-key.md): Admin-only endpoint to retrieve the project's opaque anon key (`anon_...`). The anon key is a non-secret client identifier that maps requests to the `anon` role - safe to embed in frontend bundles; row level security is the security boundary. Rotatable via POST /api/secrets/anon-key/rotate.

### Health

#### Client

- [Health check](https://docs.insforge.dev/api-reference/client/health-check.md): Check if the API is running and healthy

### Deployments

#### Admin

- [List deployments](https://docs.insforge.dev/api-reference/admin/list-deployments.md): Returns deployment runs ordered by creation time descending. Pagination metadata is returned in `Content-Range` headers.
- [Create legacy deployment session (deprecated)](https://docs.insforge.dev/api-reference/admin/create-legacy-deployment-session-deprecated.md): Creates a `WAITING` deployment run and returns presigned form data for the legacy source-zip upload flow. New tooling should use `/api/deployments/direct`.
- [Create direct-upload deployment session](https://docs.insforge.dev/api-reference/admin/create-direct-upload-deployment-session.md): Registers a source file manifest and returns file IDs for direct file uploads.
- [Get deployment metadata](https://docs.insforge.dev/api-reference/admin/get-deployment-metadata.md): Returns the latest ready deployment ID, the default deployment URL, and any custom domain URL known to the provider.
- [Update InsForge-hosted slug](https://docs.insforge.dev/api-reference/admin/update-insforge-hosted-slug.md): Updates the Cloud project slug used for the `.insforge.site` domain. Pass `null` to clear the slug.
- [List deployment environment variables](https://docs.insforge.dev/api-reference/admin/list-deployment-environment-variables.md): Lists provider environment variable keys and metadata. Values are not included.
- [Create or update deployment environment variables](https://docs.insforge.dev/api-reference/admin/create-or-update-deployment-environment-variables.md): Upserts encrypted Vercel environment variables for production, preview, and development targets.
- [Get deployment environment variable](https://docs.insforge.dev/api-reference/admin/get-deployment-environment-variable.md): Returns one provider environment variable, including its decrypted value.
- [Delete deployment environment variable](https://docs.insforge.dev/api-reference/admin/delete-deployment-environment-variable.md): Deletes a provider environment variable by Vercel environment variable ID.
- [List custom domains](https://docs.insforge.dev/api-reference/admin/list-custom-domains.md): Lists user-owned custom domains configured on the provider project.
- [Add custom domain](https://docs.insforge.dev/api-reference/admin/add-custom-domain.md): Registers a user-owned custom domain on the provider project and returns DNS setup instructions.
- [Verify custom domain](https://docs.insforge.dev/api-reference/admin/verify-custom-domain.md): Re-checks DNS configuration for a custom domain and returns the latest provider verification state.
- [Remove custom domain](https://docs.insforge.dev/api-reference/admin/remove-custom-domain.md): Removes a user-owned custom domain from the provider project.
- [Get deployment](https://docs.insforge.dev/api-reference/admin/get-deployment.md): Returns a deployment run by database ID.
- [Upload direct deployment file content](https://docs.insforge.dev/api-reference/admin/upload-direct-deployment-file-content.md): Streams one registered file through InsForge to the provider. The request body must match the manifest size and SHA-1 digest.
- [Start deployment](https://docs.insforge.dev/api-reference/admin/start-deployment.md): Starts the provider deployment after source files are available.
- [Sync deployment status](https://docs.insforge.dev/api-reference/admin/sync-deployment-status.md): Reads the latest provider state and stores it on the deployment run.
- [Cancel deployment](https://docs.insforge.dev/api-reference/admin/cancel-deployment.md): Cancels a provider deployment when available and marks the run as `CANCELED`.

### Dashboard

#### Dashboard

- [Dashboard event stream](https://docs.insforge.dev/api-reference/dashboard/dashboard-event-stream.md): Long-lived Server-Sent Events stream carrying dashboard cache-invalidation and MCP connection notifications. Emits a `ready` event on connect, then `data-update` and `mcp-connected` events as `data:` frames, with `: keepalive` comment heartbeats every 25 seconds.

## OpenAPI Specs

- [tables](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/tables.yaml)
- [schedules](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/schedules.yaml)
- [auth](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/auth.yaml)
- [records](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/records.yaml)
- [storage](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/storage.yaml)
- [ai](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/ai.yaml)
- [functions](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/functions.yaml)
- [realtime](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/realtime.yaml)
- [email](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/email.yaml)
- [payments](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/payments.yaml)
- [secrets](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/secrets.yaml)
- [logs](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/logs.yaml)
- [usage](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/usage.yaml)
- [metadata](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/metadata.yaml)
- [health](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/health.yaml)
- [deployments](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/deployments.yaml)
- [dashboard](https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/dashboard.yaml)
