Insforge Admin API

The Admin API from Insforge — 54 operation(s) for admin.

Operations 80

GET /api/ai/models Get all available AI models
GET /api/ai/overview Get Model Gateway overview
GET /api/ai/{provider}/api-key Get active provider API key
POST /api/ai/{provider}/api-key/rotate Rotate provider API key
GET /api/auth/config Get authentication configuration
PUT /api/auth/config Update authentication configuration
GET /api/auth/users List all users (admin only)
DELETE /api/auth/users Delete users (admin only)
GET /api/auth/users/{userId} Get specific user
POST /api/auth/admin/sessions Admin login
POST /api/auth/admin/sessions/exchange Exchange cloud provider authorization code for admin session
POST /api/auth/admin/refresh Refresh admin dashboard access token
POST /api/auth/admin/logout Logout admin dashboard session
POST /api/auth/tokens/anon Get anon key (deprecated)
GET /api/auth/oauth/configs List all OAuth configurations
POST /api/auth/oauth/configs Create OAuth configuration
GET /api/auth/oauth/{provider}/config Get OAuth configuration for specific provider
PUT /api/auth/oauth/{provider}/config Update OAuth configuration
DELETE /api/auth/oauth/{provider}/config Delete OAuth configuration
GET /api/auth/oauth/custom/configs List all custom OAuth configurations
POST /api/auth/oauth/custom/configs Create custom OAuth configuration
GET /api/auth/oauth/custom/{key}/config Get custom OAuth configuration
PUT /api/auth/oauth/custom/{key}/config Update custom OAuth configuration
DELETE /api/auth/oauth/custom/{key}/config Delete custom OAuth configuration
GET /api/auth/admin/sessions/current Get current admin session
GET /api/auth/smtp-config Get SMTP configuration
PUT /api/auth/smtp-config Update SMTP configuration
GET /api/auth/email-templates Get all email templates
PUT /api/auth/email-templates/{type} Update email template
GET /api/deployments List deployments
POST /api/deployments Create legacy deployment session (deprecated)
POST /api/deployments/direct Create direct-upload deployment session
GET /api/deployments/metadata Get deployment metadata
PUT /api/deployments/slug Update InsForge-hosted slug
GET /api/deployments/env-vars List deployment environment variables
POST /api/deployments/env-vars Create or update deployment environment variables
GET /api/deployments/env-vars/{id} Get deployment environment variable
DELETE /api/deployments/env-vars/{id} Delete deployment environment variable
GET /api/deployments/domains List custom domains
POST /api/deployments/domains Add custom domain
POST /api/deployments/domains/{domain}/verify Verify custom domain
DELETE /api/deployments/domains/{domain} Remove custom domain
GET /api/deployments/{id} Get deployment
PUT /api/deployments/{id}/files/{fileId}/content Upload direct deployment file content
POST /api/deployments/{id}/start Start deployment
POST /api/deployments/{id}/sync Sync deployment status
POST /api/deployments/{id}/cancel Cancel deployment
GET /api/functions List all functions
POST /api/functions Create new function
GET /api/functions/{slug} Get function details
PUT /api/functions/{slug} Update function
DELETE /api/functions/{slug} Delete function
GET /api/logs List activity logs
DELETE /api/logs Clear logs
GET /api/logs/stats Get logs statistics
GET /api/metadata Get app metadata
GET /api/metadata/database Get database metadata
GET /api/metadata/api-key Get API key
GET /api/metadata/anon-key Get anon key
GET /api/secrets List all secrets
POST /api/secrets Create a new secret
GET /api/secrets/{key} Get secret value
PUT /api/secrets/{key} Update secret
DELETE /api/secrets/{key} Delete secret
POST /api/secrets/api-key/rotate Rotate API key
POST /api/secrets/anon-key/rotate Rotate anon key
GET /api/storage/config Get storage configuration
PUT /api/storage/config Update storage configuration
GET /api/storage/buckets List All Buckets
POST /api/storage/buckets Create New Bucket
DELETE /api/storage/buckets/{bucketName} Delete Bucket
PATCH /api/storage/buckets/{bucketName} Update Bucket
GET /api/storage/buckets/{bucketName}/objects List Objects in Bucket
GET /api/database/tables List Tables
POST /api/database/tables Create Table
GET /api/database/tables/{tableName}/schema Get Table Schema
PATCH /api/database/tables/{tableName}/schema Update Table Schema
DELETE /api/database/tables/{tableName} Delete Table
GET /api/database/migrations List Database Migrations
POST /api/database/migrations Create and Execute Database Migration

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/insforge-admin-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

insforge-admin-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Insforge AI Admin API
  version: 1.0.0
  description: Model Gateway helper APIs for OpenRouter key provisioning, model discovery, and deprecated compatibility proxy routes
servers:
- url: https://api.insforge.dev
  description: Base URL declared by the provider in apis.yml (roadmap#122).
tags:
- name: Admin
paths:
  /api/ai/models:
    get:
      summary: Get all available AI models
      description: Returns the normalized OpenRouter model catalog fetched from OpenRouter with output_modalities=all.
      tags:
      - Admin
      security:
      - bearerAuth: []
      responses:
        '200':
          description: Flat array of available models from the OpenRouter catalog
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListModelsResponse'
        '401':
          description: Unauthorized
        '500':
          description: Failed to get models list
  /api/ai/overview:
    get:
      summary: Get Model Gateway overview
      description: Returns key-level OpenRouter usage and activity time series when the key has activity access.
      tags:
      - Admin
      security:
      - bearerAuth: []
      responses:
        '200':
          description: Model Gateway overview
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AIOverview'
        '401':
          description: Unauthorized
        '500':
          description: Failed to fetch overview
  /api/ai/{provider}/api-key:
    get:
      summary: Get active provider API key
      description: Returns the active provider API key details for admin copy workflows. Currently only `openrouter` is supported.
      tags:
      - Admin
      security:
      - bearerAuth: []
      parameters:
      - $ref: '#/components/parameters/AIProvider'
      responses:
        '200':
          description: Active provider API key details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenRouterKeyResponse'
        '400':
          description: Missing or unsupported provider API key
        '401':
          description: Unauthorized
        '500':
          description: Failed to fetch API key details
  /api/ai/{provider}/api-key/rotate:
    post:
      summary: Rotate provider API key
      description: Rotate the active provider API key for cloud-managed Model Gateway credentials. Currently only `openrouter` is supported.
      tags:
      - Admin
      security:
      - bearerAuth: []
      parameters:
      - $ref: '#/components/parameters/AIProvider'
      responses:
        '200':
          description: API key rotated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenRouterKeyResponse'
        '400':
          description: Unsupported provider
        '401':
          description: Unauthorized
        '500':
          description: Failed to rotate API key
  /api/auth/config:
    get:
      summary: Get authentication configuration
      description: Get current authentication settings including all configuration options (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      responses:
        '200':
          description: Authentication configuration
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  requireEmailVerification:
                    type: boolean
                  passwordMinLength:
                    type: integer
                    minimum: 4
                    maximum: 128
                  requireNumber:
                    type: boolean
                  requireLowercase:
                    type: boolean
                  requireUppercase:
                    type: boolean
                  requireSpecialChar:
                    type: boolean
                  verifyEmailMethod:
                    type: string
                    enum:
                    - code
                    - link
                    description: Method for email verification (code = 6-digit OTP, link = magic link)
                  resetPasswordMethod:
                    type: string
                    enum:
                    - code
                    - link
                    description: Method for password reset (code = 6-digit OTP + exchange flow, link = magic link)
                  allowedRedirectUrls:
                    type: array
                    items:
                      type: string
                    description: List of allowed URLs for authentication redirects. If empty, all redirects are allowed for smoother development UX. This is not recommended in production.
                  disableSignup:
                    type: boolean
                    description: When true, public sign-up endpoints (POST /api/auth/users and first-time OAuth) are rejected with 403 AUTH_SIGNUP_DISABLED. Admin-authenticated user creation is unaffected.
                  createdAt:
                    type: string
                    format: date-time
                  updatedAt:
                    type: string
                    format: date-time
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
    put:
      summary: Update authentication configuration
      description: Update authentication settings (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                requireEmailVerification:
                  type: boolean
                passwordMinLength:
                  type: integer
                  minimum: 4
                  maximum: 128
                requireNumber:
                  type: boolean
                requireLowercase:
                  type: boolean
                requireUppercase:
                  type: boolean
                requireSpecialChar:
                  type: boolean
                verifyEmailMethod:
                  type: string
                  enum:
                  - code
                  - link
                  description: Method for email verification (code = 6-digit OTP, link = magic link)
                resetPasswordMethod:
                  type: string
                  enum:
                  - code
                  - link
                  description: Method for password reset (code = 6-digit OTP + exchange flow, link = magic link)
                allowedRedirectUrls:
                  type: array
                  items:
                    type: string
                  description: List of allowed URLs for authentication redirects. If empty, all redirects are allowed for smoother development UX. This is not recommended in production.
                disableSignup:
                  type: boolean
                  description: When true, public sign-up endpoints (POST /api/auth/users and first-time OAuth) are rejected with 403 AUTH_SIGNUP_DISABLED. Admin-authenticated user creation is unaffected.
      responses:
        '200':
          description: Configuration updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  requireEmailVerification:
                    type: boolean
                  passwordMinLength:
                    type: integer
                    minimum: 4
                    maximum: 128
                  requireNumber:
                    type: boolean
                  requireLowercase:
                    type: boolean
                  requireUppercase:
                    type: boolean
                  requireSpecialChar:
                    type: boolean
                  verifyEmailMethod:
                    type: string
                    enum:
                    - code
                    - link
                  resetPasswordMethod:
                    type: string
                    enum:
                    - code
                    - link
                  allowedRedirectUrls:
                    type: array
                    items:
                      type: string
                    description: List of allowed URLs for authentication redirects. If empty, all redirects are allowed for smoother development UX. This is not recommended in production.
                  disableSignup:
                    type: boolean
                    description: When true, public sign-up endpoints (POST /api/auth/users and first-time OAuth) are rejected with 403 AUTH_SIGNUP_DISABLED. Admin-authenticated user creation is unaffected.
                  createdAt:
                    type: string
                    format: date-time
                  updatedAt:
                    type: string
                    format: date-time
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
  /api/auth/users:
    get:
      summary: List all users (admin only)
      description: Returns paginated list of users
      tags:
      - Admin
      security:
      - bearerAuth: []
      parameters:
      - name: offset
        in: query
        schema:
          type: string
          default: '0'
        description: Number of records to skip
      - name: limit
        in: query
        schema:
          type: string
          default: '10'
        description: Maximum number of records to return
      - name: search
        in: query
        schema:
          type: string
        description: Search by email or name
      responses:
        '200':
          description: List of users
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/UserResponse'
                  pagination:
                    type: object
                    properties:
                      offset:
                        type: integer
                      limit:
                        type: integer
                      total:
                        type: integer
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
    delete:
      summary: Delete users (admin only)
      description: Delete multiple users by their IDs
      tags:
      - Admin
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userIds:
                  type: array
                  items:
                    type: string
              required:
              - userIds
      responses:
        '200':
          description: Users deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  deletedCount:
                    type: integer
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
  /api/auth/users/{userId}:
    get:
      summary: Get specific user
      description: Get user details by ID (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      parameters:
      - name: userId
        in: path
        required: true
        schema:
          type: string
          format: uuid
        description: User ID
      responses:
        '200':
          description: User details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        '400':
          description: Invalid user ID format
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
        '404':
          description: User not found
  /api/auth/admin/sessions:
    post:
      summary: Admin login
      description: Authenticates admin user for dashboard access
      tags:
      - Admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - username
              - password
              properties:
                username:
                  type: string
                  example: admin
                password:
                  type: string
      responses:
        '200':
          description: Admin login successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  projectAdmin:
                    $ref: '#/components/schemas/ProjectAdminResponse'
                  accessToken:
                    type: string
                  csrfToken:
                    type: string
                    description: CSRF token for `/api/auth/admin/refresh`
        '401':
          description: Invalid credentials
        '403':
          description: User is not an admin
  /api/auth/admin/sessions/exchange:
    post:
      summary: Exchange cloud provider authorization code for admin session
      description: Verifies an authorization code/JWT from from Insforge Cloud platform and issues an internal admin session token with project_admin role
      tags:
      - Admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - code
              properties:
                code:
                  type: string
                  description: Authorization code or JWT from the Insforge
                  example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
      responses:
        '200':
          description: Cloud authorization verified, admin session created
          content:
            application/json:
              schema:
                type: object
                properties:
                  projectAdmin:
                    $ref: '#/components/schemas/ProjectAdminResponse'
                  accessToken:
                    type: string
                    description: Internal JWT for admin authentication
                  csrfToken:
                    type: string
                    description: CSRF token for `/api/auth/admin/refresh`
        '400':
          description: Invalid authorization code or JWT verification failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /api/auth/admin/refresh:
    post:
      summary: Refresh admin dashboard access token
      description: Uses the dashboard-only httpOnly `insforge_admin_refresh_token` cookie with an `X-CSRF-Token` header.
      tags:
      - Admin
      parameters:
      - name: X-CSRF-Token
        in: header
        required: true
        schema:
          type: string
        description: CSRF token returned from admin login or admin refresh
      responses:
        '200':
          description: Admin token refreshed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  projectAdmin:
                    $ref: '#/components/schemas/ProjectAdminResponse'
                  accessToken:
                    type: string
                  csrfToken:
                    type: string
                    description: CSRF token for the next admin refresh request
        '401':
          description: No admin refresh token provided or project admin not found
        '403':
          description: Invalid CSRF token
  /api/auth/admin/logout:
    post:
      summary: Logout admin dashboard session
      description: 'Clears the dashboard-only `insforge_admin_refresh_token` cookie.


        If a valid admin refresh cookie is present, the request must include the `X-CSRF-Token`

        header returned from admin login, admin session exchange, or admin refresh. Missing, expired,

        invalid, or wrong-session-type admin refresh cookies are cleared idempotently and still return

        success.

        '
      tags:
      - Admin
      parameters:
      - name: X-CSRF-Token
        in: header
        schema:
          type: string
        description: CSRF token required when a valid admin refresh cookie is present
      responses:
        '200':
          description: Logged out successfully. Also returned when the admin refresh cookie is missing, expired, invalid, or the wrong session type.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
        '403':
          description: Invalid or missing CSRF token for a valid admin refresh cookie
  /api/auth/tokens/anon:
    post:
      summary: Get anon key (deprecated)
      deprecated: true
      description: 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 JWT and can be rotated via POST /api/secrets/anon-key/rotate (admin only).
      tags:
      - Admin
      security:
      - bearerAuth: []
      responses:
        '200':
          description: Anon key retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  accessToken:
                    type: string
                    description: Opaque anon key (legacy field name kept for compatibility)
                    example: anon_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd
                  message:
                    type: string
                    description: Success message
                    example: Anon key retrieved successfully (deprecated route, use GET /api/metadata/anon-key)
        '401':
          description: Unauthorized - requires authentication
        '403':
          description: Forbidden - admin access required
        '404':
          description: Anon key not initialized
  /api/auth/oauth/configs:
    get:
      summary: List all OAuth configurations
      description: Get all configured OAuth providers (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      responses:
        '200':
          description: List of OAuth configurations
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/OAuthConfig'
                  count:
                    type: integer
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
    post:
      summary: Create OAuth configuration
      description: Create a new OAuth provider configuration (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - provider
              properties:
                provider:
                  type: string
                  enum:
                  - google
                  - github
                  - discord
                  - linkedin
                  - facebook
                  - instagram
                  - tiktok
                  - apple
                  - x
                  - spotify
                  - microsoft
                clientId:
                  type: string
                clientSecret:
                  type: string
                redirectUri:
                  type: string
                scopes:
                  type: array
                  items:
                    type: string
                useSharedKey:
                  type: boolean
      responses:
        '200':
          description: OAuth configuration created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthConfig'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
  /api/auth/oauth/{provider}/config:
    get:
      summary: Get OAuth configuration for specific provider
      description: Get OAuth configuration including client secret (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      parameters:
      - name: provider
        in: path
        required: true
        schema:
          type: string
          enum:
          - google
          - github
          - discord
          - linkedin
          - facebook
          - instagram
          - tiktok
          - apple
          - x
          - spotify
          - microsoft
      responses:
        '200':
          description: OAuth configuration
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/OAuthConfig'
                - type: object
                  properties:
                    clientSecret:
                      type: string
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
        '404':
          description: Configuration not found
    put:
      summary: Update OAuth configuration
      description: Update OAuth provider configuration (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      parameters:
      - name: provider
        in: path
        required: true
        schema:
          type: string
          enum:
          - google
          - github
          - discord
          - linkedin
          - facebook
          - instagram
          - tiktok
          - apple
          - x
          - spotify
          - microsoft
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clientId:
                  type: string
                clientSecret:
                  type: string
                redirectUri:
                  type: string
                scopes:
                  type: array
                  items:
                    type: string
                useSharedKey:
                  type: boolean
      responses:
        '200':
          description: Configuration updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthConfig'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
        '404':
          description: Configuration not found
    delete:
      summary: Delete OAuth configuration
      description: Delete OAuth provider configuration (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      parameters:
      - name: provider
        in: path
        required: true
        schema:
          type: string
          enum:
          - google
          - github
          - discord
          - linkedin
          - facebook
          - instagram
          - tiktok
          - apple
          - x
          - spotify
          - microsoft
      responses:
        '200':
          description: Configuration deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
        '404':
          description: Configuration not found
  /api/auth/oauth/custom/configs:
    get:
      summary: List all custom OAuth configurations
      description: Get all configured custom OAuth providers (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      responses:
        '200':
          description: List of custom OAuth configurations
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CustomOAuthConfig'
                  count:
                    type: integer
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
    post:
      summary: Create custom OAuth configuration
      description: Create a new custom OAuth provider configuration (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - key
              - name
              - discoveryEndpoint
              - clientId
              - clientSecret
              properties:
                key:
                  type: string
                name:
                  type: string
                discoveryEndpoint:
                  type: string
                  format: uri
                clientId:
                  type: string
                clientSecret:
                  type: string
      responses:
        '200':
          description: Custom OAuth configuration created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomOAuthConfig'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
        '409':
          description: Configuration already exists
  /api/auth/oauth/custom/{key}/config:
    get:
      summary: Get custom OAuth configuration
      description: Get a custom OAuth configuration including client secret (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      parameters:
      - name: key
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Custom OAuth configuration
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/CustomOAuthConfig'
                - type: object
                  properties:
                    clientSecret:
                      type: string
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
        '404':
          description: Configuration not found
    put:
      summary: Update custom OAuth configuration
      description: Update a custom OAuth provider configuration (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      parameters:
      - name: key
        in: path
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                discoveryEndpoint:
                  type: string
                  format: uri
                clientId:
                  type: string
                clientSecret:
                  type: string
      responses:
        '200':
          description: Custom OAuth configuration updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomOAuthConfig'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
        '404':
          description: Configuration not found
    delete:
      summary: Delete custom OAuth configuration
      description: Delete a custom OAuth provider configuration (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      parameters:
      - name: key
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Configuration deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
        '404':
          description: Configuration not found
  /api/auth/admin/sessions/current:
    get:
      summary: Get current admin session
      description: Returns the currently authenticated admin's basic info from the access token.
      tags:
      - Admin
      security:
      - bearerAuth: []
      responses:
        '200':
          description: Current admin session info
          content:
            application/json:
              schema:
                type: object
                properties:
                  admin:
                    type: object
                    properties:
                      sub:
                        type: string
                        description: Admin subject identifier
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin access required
  /api/auth/smtp-config:
    get:
      summary: Get SMTP configuration
      description: Get current SMTP email configuration (admin only)
      tags:
      - Admin
      security:
      - bearerAuth: []
      x-internal: true
      responses:
        '200':
          description: SMTP configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmtpConfig'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Admin only
    put:
      summary: Update SMTP configuration
      description: '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.

        '
      tags:
      - Admin
      security:
      - bearerAuth: []
      x-internal: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - enabled
              - port
              properties:
                enabled:
                  type: boolean
                  description: When true, host/username/senderEmail/senderName become required
                host:
                  type: string
                  description: Required when enabled is true
                port:
                  type: integer
                  enum:
                  - 25
                  - 465
                  - 587
                  - 2525
                username:
                  type: string
                  description: Required when enabled is true
                password:
                  type: string
                  description: SMTP password (optional on update if unchanged)
                senderEmail:
                  type: string
                  format: e

# --- truncated at 32 KB (145 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/insforge/refs/heads/main/openapi/insforge-admin-api-openapi.yml