openapi: 3.1.0
info:
  title: LightOn API
  version: 3.15.0 (v3-company)
  description: LightOn gives you an API to search, parse, and ingest documents at
    scale. Build knowledge-retrieval pipelines without managing vector databases or
    OCR models.
paths:
  /api/v3/company/metrics:
    get:
      operationId: api_v3_company_metrics_retrieve
      description: |-
        Return activity metrics for the authenticated user's own company: number of workspaces, number of indexed (embedded) documents, and the count of search + ask (RAG) calls across all of the company's API keys over the last 30 days (served from the cached usage histogram).

        **Authorization:** any authenticated member of the company. Instance admins reading another company should use the instance-level equivalent.
      summary: Get your company's activity metrics
      tags:
      - Usage
      security:
      - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyMetricsResponse'
          description: ''
        '401':
          description: Unauthenticated - missing or invalid API key.
        '404':
          description: Not Found - the caller is not attached to a company.
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/external_keys/{provider}:
    put:
      operationId: api_v3_company_external_keys_update
      description: Creates or replaces the active company-level API key for the given
        provider. The previous key (if any) is deactivated. Key value is never returned.
        Requires company admin permission.
      summary: Set company external API key
      parameters:
      - in: path
        name: provider
        schema:
          type: string
        required: true
      tags:
      - Models
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetExternalAPIKeyRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/SetExternalAPIKeyRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/SetExternalAPIKeyRequest'
        required: true
      security:
      - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalAPIKeyResponse'
          description: Company key saved. The previous active key for this provider
            (if any) has been deactivated.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: You do not have permission to perform this action.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Insufficient permissions
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    delete:
      operationId: api_v3_company_external_keys_destroy
      description: Soft-deletes the active company-level API key for the given provider.
        Requires company admin permission.
      summary: Deactivate company external API key
      parameters:
      - in: path
        name: provider
        schema:
          type: string
        required: true
      tags:
      - Models
      security:
      - bearerAuth: []
      responses:
        '204':
          description: Company key deactivated successfully.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: You do not have permission to perform this action.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Insufficient permissions
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: The requested resource was not found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not Found
          description: The requested resource was not found
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/model-catalog:
    get:
      operationId: api_v3_company_model_catalog_list
      description: 'Return the known models for a SaaS provider, to populate the model
        picker in the custom-model create flow. Derived from LiteLLM''s published
        model cost map, refreshed daily, and filtered to models that are registrable
        as custom models and not past their published deprecation date. The catalogue
        is a convenience, not a constraint: create accepts any litellm_model string,
        so a model absent from the list can still be registered by entering it directly.
        An empty list is a valid response — the provider may publish no models of
        the requested type, or the catalogue may be briefly unavailable. Requires
        company admin role.'
      summary: List catalogued provider models
      parameters:
      - in: query
        name: model_type
        schema:
          type: string
          enum:
          - Embedding Model
          - Large Language Model
          - Multi-Vector Model
          - Vision Language Model
        description: Narrow the catalogue to a single model type. Omit to return every
          entry.
      - in: query
        name: provider
        schema:
          type: string
          enum:
          - anthropic
          - gemini
          - mistral
          - openai
        description: Provider whose catalogue to return.
        required: true
      tags:
      - Models
      security:
      - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProviderCatalogEntryResponse'
              examples:
                AnthropicLanguageModels:
                  value:
                  - - litellm_model: anthropic/claude-opus-5
                      label: claude-opus-5
                      model_type: Large Language Model
                      max_input_tokens: 1000000
                      required_temperature: 1.0
                      max_temperature: 1.0
                    - litellm_model: anthropic/claude-haiku-4-5
                      label: claude-haiku-4-5
                      model_type: Large Language Model
                      max_input_tokens: 200000
                      required_temperature: null
                      max_temperature: 1.0
                  summary: Anthropic language models
          description: ''
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: Admin access required.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Admin access required. Only company admins and superadmins
            can write custom models.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                UnknownProvider:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      provider:
                      - error: invalid_choice
                        detail: 'Unknown provider ''cohere''. Expected one of: anthropic,
                          gemini, mistral, openai.'
                  summary: Unknown provider
                MissingProvider:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      provider:
                      - error: required
                        detail: This query parameter is required.
                  summary: Missing provider
          description: The provider is missing, or the provider or model type is not
            recognised.
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/model-config/export:
    get:
      operationId: api_v3_company_model_config_export_retrieve
      description: Returns the list of models assigned to the authenticated user's
        company as a JSON config. API keys are never included.
      summary: Export company model configuration
      tags:
      - Models
      security:
      - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/model-config/import:
    post:
      operationId: api_v3_company_model_config_import_create
      description: 'Assign models to the authenticated user''s company from a JSON
        config. Idempotent: existing assignments are skipped. Unknown model UUIDs
        are reported as errors.'
      summary: Import company model configuration
      tags:
      - Models
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyModelConfig'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CompanyModelConfig'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CompanyModelConfig'
      security:
      - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyModelConfigImportResultResponse'
          description: ''
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/models:
    get:
      operationId: api_v3_company_models_list
      description: List all custom ML models registered by the authenticated user's
        company. Visible to all authenticated company members.
      summary: List custom models
      tags:
      - Models
      security:
      - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomMLModelResponse'
              examples:
                CustomModel:
                  value:
                  - id: a08cff52-1a96-49f4-9f28-84a060b9264c
                    name: Gemma 4 (local LM Studio)
                    technical_name: custom-42-a08cff52-1a96-49f4-9f28-84a060b9264c
                    litellm_model: openai/google/gemma-4-e4b
                    model_type: Large Language Model
                    endpoint: http://host.docker.internal:1234/v1
                    enabled: true
                    is_default: false
                    temperature: 0.2
                    required_temperature: null
                    max_temperature: null
                  summary: Custom model
          description: ''
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    post:
      operationId: api_v3_company_models_create
      description: Register a new custom ML model for the authenticated user's company.
        The litellm_model field is immutable after creation. For OpenAI-compatible
        endpoints (LM Studio, Ollama), prefix with 'openai/' (e.g. 'openai/llama3').
        An optional temperature is applied to every request sent to this model, in
        place of whatever the calling feature would otherwise use. Some models accept
        exactly one temperature and are set to it regardless of what is submitted;
        the model catalogue reports that value as required_temperature. Requires company
        admin role.
      summary: Create a custom model
      tags:
      - Models
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomMLModelCreateRequest'
            examples:
              LMStudioModel:
                value:
                  name: Gemma 4 (local LM Studio)
                  litellm_model: openai/google/gemma-4-e4b
                  model_type: Large Language Model
                  endpoint: http://host.docker.internal:1234/v1
                  api_key: null
                  temperature: 0.2
                summary: LM Studio model
              CustomModel:
                value:
                  id: a08cff52-1a96-49f4-9f28-84a060b9264c
                  name: Gemma 4 (local LM Studio)
                  technical_name: custom-42-a08cff52-1a96-49f4-9f28-84a060b9264c
                  litellm_model: openai/google/gemma-4-e4b
                  model_type: Large Language Model
                  endpoint: http://host.docker.internal:1234/v1
                  enabled: true
                  is_default: false
                  temperature: 0.2
                  required_temperature: null
                  max_temperature: null
                summary: Custom model
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CustomMLModelCreateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CustomMLModelCreateRequest'
        required: true
      security:
      - bearerAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomMLModelResponse'
              examples:
                LMStudioModel:
                  value:
                    name: Gemma 4 (local LM Studio)
                    litellm_model: openai/google/gemma-4-e4b
                    model_type: Large Language Model
                    endpoint: http://host.docker.internal:1234/v1
                    api_key: null
                    temperature: 0.2
                  summary: LM Studio model
                CustomModel:
                  value:
                    id: a08cff52-1a96-49f4-9f28-84a060b9264c
                    name: Gemma 4 (local LM Studio)
                    technical_name: custom-42-a08cff52-1a96-49f4-9f28-84a060b9264c
                    litellm_model: openai/google/gemma-4-e4b
                    model_type: Large Language Model
                    endpoint: http://host.docker.internal:1234/v1
                    enabled: true
                    is_default: false
                    temperature: 0.2
                    required_temperature: null
                    max_temperature: null
                  summary: Custom model
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                AboveTheProviderMaximum:
                  value:
                    id: null
                    code: 400
                    error: bad_request
                    detail: Temperature 1.5 is above the maximum of 1.0 accepted by
                      this model's provider.
                    doc_url: https://developers.lighton.ai/errors#bad_request
                  summary: Above the provider maximum
                CustomModelsUnavailableOnThisDeployment:
                  value:
                    id: null
                    code: 400
                    error: bad_request
                    detail: 'This deployment cannot serve company custom models: they
                      are only available when the LiteLLM gateway is the configured
                      model provider.'
                    doc_url: https://developers.lighton.ai/errors#bad_request
                  summary: Custom models unavailable on this deployment
          description: |-
            Either the requested temperature is above the maximum the model's provider accepts (see the update endpoint for the per-provider ceilings), or the deployment cannot serve company custom models at all.

            The second is only possible here, on registration: it depends on the configured model provider, and the same request would succeed on a deployment using the LiteLLM gateway. Listing and deleting stay available either way, so models registered before a provider change can still be cleaned up.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: Admin access required.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Admin access required. Only company admins and superadmins
            can write custom models.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                MissingRequiredField:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      litellm_model:
                      - error: required
                        detail: Field required
                  summary: Missing required field
                DuplicateName:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      name:
                      - error: already_exists
                        detail: A custom model named 'My GPT-4' already exists for
                          this company.
                  summary: Duplicate name
          description: A required field is missing, a field holds a value of the wrong
            type, or the name collides with an existing custom model in the same company.
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/models/{uuid}:
    get:
      operationId: api_v3_company_models_retrieve
      description: Retrieve a single custom ML model by UUID. Only returns models
        belonging to the authenticated user's company.
      summary: Get a custom model
      parameters:
      - in: path
        name: uuid
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - Models
      security:
      - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomMLModelResponse'
              examples:
                CustomModel:
                  value:
                    id: a08cff52-1a96-49f4-9f28-84a060b9264c
                    name: Gemma 4 (local LM Studio)
                    technical_name: custom-42-a08cff52-1a96-49f4-9f28-84a060b9264c
                    litellm_model: openai/google/gemma-4-e4b
                    model_type: Large Language Model
                    endpoint: http://host.docker.internal:1234/v1
                    enabled: true
                    is_default: false
                    temperature: 0.2
                    required_temperature: null
                    max_temperature: null
                  summary: Custom model
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: Custom model a08cff52-1a96-49f4-9f28-84a060b9264c not
                      found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not found
          description: Custom model not found or does not belong to the authenticated
            user's company.
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    patch:
      operationId: api_v3_company_models_partial_update
      description: 'Update a custom ML model''s name or temperature, or promote it
        to the company default. Everything else is fixed at creation: the litellm_model,
        the model type, the endpoint, and the API key cannot be changed, because the
        credential is write-only in the gateway and cannot be rewritten without first
        being read back. Register a new model to change any of them. A model whose
        provider accepts exactly one temperature keeps that one whatever is submitted.
        Requires company admin role.'
      summary: Update a custom model
      parameters:
      - in: path
        name: uuid
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - Models
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCustomMLModelUpdateRequest'
            examples:
              CustomModel:
                value:
                  id: a08cff52-1a96-49f4-9f28-84a060b9264c
                  name: Gemma 4 (local LM Studio)
                  technical_name: custom-42-a08cff52-1a96-49f4-9f28-84a060b9264c
                  litellm_model: openai/google/gemma-4-e4b
                  model_type: Large Language Model
                  endpoint: http://host.docker.internal:1234/v1
                  enabled: true
                  is_default: false
                  temperature: 0.2
                  required_temperature: null
                  max_temperature: null
                summary: Custom model
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCustomMLModelUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCustomMLModelUpdateRequest'
      security:
      - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomMLModelResponse'
              examples:
                CustomModel:
                  value:
                    id: a08cff52-1a96-49f4-9f28-84a060b9264c
                    name: Gemma 4 (local LM Studio)
                    technical_name: custom-42-a08cff52-1a96-49f4-9f28-84a060b9264c
                    litellm_model: openai/google/gemma-4-e4b
                    model_type: Large Language Model
                    endpoint: http://host.docker.internal:1234/v1
                    enabled: true
                    is_default: false
                    temperature: 0.2
                    required_temperature: null
                    max_temperature: null
                  summary: Custom model
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                AboveTheProviderMaximum:
                  value:
                    id: null
                    code: 400
                    error: bad_request
                    detail: Temperature 1.5 is above the maximum of 1.0 accepted by
                      this model's provider.
                    doc_url: https://developers.lighton.ai/errors#bad_request
                  summary: Above the provider maximum
          description: The requested temperature is above the maximum the model's
            provider accepts. Anthropic accepts up to 1.0; OpenAI and Gemini up to
            2.0. A model served from its own endpoint is not bound by the provider
            named in its routing string.
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: Admin access required.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Admin access required. Only company admins and superadmins
            can write custom models.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: Custom model a08cff52-1a96-49f4-9f28-84a060b9264c not
                      found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not found
          description: Custom model not found or does not belong to the authenticated
            user's company.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                MissingRequiredField:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      litellm_model:
                      - error: required
                        detail: Field required
                  summary: Missing required field
                DuplicateName:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      name:
                      - error: already_exists
                        detail: A custom model named 'My GPT-4' already exists for
                          this company.
                  summary: Duplicate name
          description: A required field is missing, a field holds a value of the wrong
            type, or the name collides with an existing custom model in the same company.
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    delete:
      operationId: api_v3_company_models_destroy
      description: Delete a custom ML model and immediately deregister it from LiteLLM.
        Requires company admin role.
      summary: Delete a custom model
      parameters:
      - in: path
        name: uuid
        schema:
          type: string
          format: uuid
        required: true
      tags:
      - Models
      security:
      - bearerAuth: []
      responses:
        '204':
          description: No response body
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: Admin access required.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Admin access required. Only company admins and superadmins
            can write custom models.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: Custom model a08cff52-1a96-49f4-9f28-84a060b9264c not
                      found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not found
          description: Custom model not found or does not belong to the authenticated
            user's company.
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/workspaces:
    get:
      operationId: api_v3_company_workspaces_list
      description: |-
        ⚠️ **ALPHA ENDPOINT** - This endpoint is in alpha and subject to breaking changes. Use with caution in production environments.

        Get the list of all workspaces within the authenticated user's company.
      summary: List workspaces in your company
      parameters:
      - in: query
        name: datasource_type
        schema:
          type: string
          enum:
          - googledrive
          - servicenow
          - sharepoint
          - webscrapper
        description: |-
          The type of data source.

          * `servicenow` - ServiceNow
          * `googledrive` - Google Drive
          * `sharepoint` - SharePoint
          * `webscrapper` - WebScrapper
      - in: query
        name: document_upload_method
        schema:
          type: string
          enum:
          - manual
          - synced
        description: |-
          Method for adding documents to this workspace: manual uploads or synced from datasources

          * `manual` - Manual
          * `synced` - Synced
      - in: query
        name: group_id
        schema:
          type: integer
      - in: query
        name: group_name
        schema:
          type: string
      - in: query
        name: name
        schema:
          type: string
      - in: query
        name: ordering
        schema:
          type: string
          enum:
          - -created_at
          - -name
          - -updated_at
          - created_at
          - name
          - updated_at
        description: Order the results by `name`, `created_at` or `updated_at`. Prefix
          the field with `-` for descending order (e.g. `-created_at`). Defaults to
          `name`; entries sharing a name are ordered newest-first.
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      - in: query
        name: workspace_type
        schema:
          type: string
          enum:
          - personal
          - public
          - shared
        description: |-
          * `shared` - Shared
          * `personal` - Personal
          * `public` - Public
      tags:
      - Workspaces
      security:
      - bearerAuth: []
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCompanyWorkspaceV3ListResponseList'
          description: List of workspaces in the user's company
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          description: Permission denied - insufficient rights to access company workspaces
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    post:
      operationId: api_v3_company_workspaces_create
      description: |-
        ⚠️ **ALPHA ENDPOINT** - This endpoint is in alpha and subject to breaking changes. Use with caution in production environments.

        Create a new workspace within your company. Available to company and instance-level administrators.
      summary: Create a workspace in your company
      tags:
      - Workspaces
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyWorkspaceCreateV3Request'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CompanyWorkspaceCreateV3Request'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CompanyWorkspaceCreateV3Request'
        required: true
      security:
      - bearerAuth: []
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyWorkspaceV3DetailsResponse'
          description: Workspace created successfully
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '401':
          description: Authentication required - missing or invalid credentials
        '403':
          description: Permission denied - user does not have permission to create
            workspaces
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Conflict:
                  value:
                    id: null
                    code: 409
                    error: conflict
                    detail: A resource with this name already exists.
                    doc_url: https://developers.lighton.ai/errors#conflict
          description: A resource with this name already exists
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                InternalServerError:
                  value:
                    id: null
                    code: 500
                    error: internal_server_error
                    detail: An unexpected error occurred. Please try again later.
                    doc_url: https://developers.lighton.ai/errors#internal_server_error
                  summary: Internal Server Error
          description: An unexpected error occurred
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/workspaces/datasource/test:
    post:
      operationId: api_v3_company_workspaces_datasource_test_create
      description: |-
        ⚠️ **ALPHA ENDPOINT** - This endpoint is in alpha and subject to breaking changes. Use with caution in production environments.

        Test datasource credentials without creating anything.

        Validates that the provided credentials can connect to the external source. Succeeds when the connection can be established; returns an error otherwise. No datasource or import is created.

        **Access:** Company admin only.

        Credentials per type:
        - **googledrive**: `service_account_file` (JSON string of the service account key file)
        - **sharepoint**: `client_id`, `client_secret`, `tenant_id`, `site_id` (optional), `site_name` (optional)
        - **servicenow**: `instance_url`, `username`, `password`
        - **webscrapper**: no credentials required

        Filter criteria per type:
        - **googledrive**: `folder_id` (required), `recursive` (optional)
        - **sharepoint**: `folder_path` (required), `recursive` (optional)
        - **servicenow**: `doc_type` (required, e.g. `knowledge`)
        - **webscrapper**: `start_url` (required)
      summary: Test datasource credentials
      tags:
      - Workspaces
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StandardWorkspaceDatasourceV3Request'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/StandardWorkspaceDatasourceV3Request'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/StandardWorkspaceDatasourceV3Request'
        required: true
      security:
      - bearerAuth: []
      responses:
        '200':
          description: Connection successful
        '400':
          description: Bad Request - Invalid credentials or connection failure to
            the external datasource
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: You do not have permission to perform this action.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Insufficient permissions
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/workspaces/{id}:
    get:
      operationId: api_v3_company_workspaces_retrieve
      description: |-
        ⚠️ **ALPHA ENDPOINT** - This endpoint is in alpha and subject to breaking changes. Use with caution in production environments.

        Retrieve the information of a workspace in your company. This endpoint is available to company-level and instance-level administrators.
      summary: Retrieve a company workspace
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: The unique identifier of the workspace.
        required: true
      tags:
      - Workspaces
      security:
      - bearerAuth: []
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyWorkspaceV3DetailsResponse'
          description: ''
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    patch:
      operationId: api_v3_company_workspaces_partial_update
      description: |-
        ⚠️ **ALPHA ENDPOINT** - This endpoint is in alpha and subject to breaking changes. Use with caution in production environments.

        Partially update a given workspace. The authenticated user must be a company or instance-level administrator.

        **Standard update:**
        - **name** (string, optional): Desired workspace name
        - **description** (string, optional): Desired workspace description. Send empty string or null to clear.

        **Convert to synced workspace:**
        Provide a `datasource` object to convert a manual workspace into a read-only synced workspace. This creates a datasource and schedules a first import immediately.

        ```json
        {
          "datasource": {
            "type": "googledrive|sharepoint|servicenow|webscrapper",
            "name": "My datasource",
            "credentials": { ... },
            "filter_criteria": { ... }
          }
        }
        ```

        Credentials per type:
        - **googledrive**: `service_account_file` (JSON string)
        - **sharepoint**: `client_id`, `client_secret`, `tenant_id`, `site_id` (optional), `site_name` (optional)
        - **servicenow**: `instance_url`, `username`, `password`
        - **webscrapper**: no credentials required

        Filter criteria per type:
        - **googledrive**: `folder_id` (required), `recursive` (optional)
        - **sharepoint**: `folder_path` (required), `recursive` (optional)
        - **servicenow**: `doc_type` (required, e.g. `knowledge`)
        - **webscrapper**: `start_url` (required)

        **Edit an existing synced workspace's datasource:**
        Sending a `datasource` payload on an already-synced workspace edits the datasource in place — but only while no successful sync has happened yet. After the first success the datasource config is locked, and it is also locked while a sync is in flight (waiting/processing). Type cannot change on edit. The current editability is exposed in the response under `sync.editable`.

        **Permissions:**
        - Company Admins can update workspaces within their company
        - Instance-level administrators can update any workspace
        - Conversion is one-way (cannot revert to manual)
      summary: Update a company workspace
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: The unique identifier of the workspace.
        required: true
      tags:
      - Workspaces
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCompanyWorkspaceUpdateV3Request'
            examples:
              RestoreASoft-deletedWorkspace:
                value:
                  deleted_at: null
                summary: Restore a soft-deleted workspace
              RestoreUnderANewName(resolvesANameCollision):
                value:
                  deleted_at: null
                  name: Project Apollo (restored)
                summary: Restore under a new name (resolves a name collision)
              RestoreAndUpdateTheDescription:
                value:
                  deleted_at: null
                  description: Reinstated after review
                summary: Restore and update the description
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedCompanyWorkspaceUpdateV3Request'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedCompanyWorkspaceUpdateV3Request'
      security:
      - bearerAuth: []
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyWorkspaceV3DetailsResponse'
          description: Workspace updated successfully
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '401':
          description: Unauthenticated - Missing or invalid API key/session cookie
        '403':
          description: Unauthorized - User does not have permission to update company
            workspaces
        '404':
          description: Not Found - Workspace does not exist or belongs to another
            company
        '409':
          description: Conflict - Workspace name already exists in the company, or
            datasource edit rejected because a successful sync has already happened
            (config locked) or a sync is currently in flight.
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    delete:
      operationId: api_v3_company_workspaces_destroy
      description: |-
        ⚠️ **ALPHA ENDPOINT** - This endpoint is in alpha and subject to breaking changes. Use with caution in production environments.

        Soft-delete a custom workspace in your company.

        The workspace and its memberships are marked as deleted but retained for the configured recovery period; collection data (documents, chunks, embeddings) is preserved until the workspace is permanently deleted by the cleanup task. The workspace can be restored within the recovery period via `PATCH` with `deleted_at=null` (use `?include_deleted=true` to address it after deletion).

        **Restrictions:**
        - PERSONAL workspaces cannot be deleted (system-managed)
        - Caller must have permission to delete workspaces in their company
      summary: Delete a company workspace
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: The unique identifier of the workspace.
        required: true
      tags:
      - Workspaces
      security:
      - bearerAuth: []
      - {}
      responses:
        '204':
          description: Workspace soft-deleted
        '401':
          description: Unauthenticated - Missing or invalid API key/session cookie
        '403':
          description: Forbidden - System-managed workspace or caller lacks permission
        '404':
          description: Not Found - Workspace does not exist or belongs to another
            company
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/workspaces/{id}/members:
    get:
      operationId: api_v3_company_workspaces_members_retrieve
      description: Returns the list of members linked to a workspace in the authenticated
        user's company. This endpoint can only be used by company-level admins or
        higher.
      summary: Retrieve workspace members
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      tags:
      - Workspaces
      security:
      - bearerAuth: []
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceMembersV3Response'
          description: ''
        '401':
          content:
            application/json:
              schema:
                description: Unauthenticated
          description: ''
        '403':
          content:
            application/json:
              schema:
                description: Unauthorized
          description: ''
        '404':
          content:
            application/json:
              schema:
                description: Not Found
          description: ''
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    post:
      operationId: api_v3_company_workspaces_members_create
      description: |-
        ⚠️ **ALPHA ENDPOINT** - This endpoint is in alpha and subject to breaking changes. Use with caution in production environments.

        Add a new member (user or group) to a custom workspace of the authenticated user's company. This endpoint can only be used by company-level admins or higher.
      summary: Add a member to a workspace of your company
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      tags:
      - Workspaces
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InstanceWorkspaceAddMemberV3Request'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/InstanceWorkspaceAddMemberV3Request'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/InstanceWorkspaceAddMemberV3Request'
        required: true
      security:
      - bearerAuth: []
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceMembersV3Response'
          description: Member added successfully
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: You do not have permission to perform this action.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Insufficient permissions
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: The requested resource was not found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not Found
          description: The requested resource was not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Conflict:
                  value:
                    id: null
                    code: 409
                    error: conflict
                    detail: A resource with this name already exists.
                    doc_url: https://developers.lighton.ai/errors#conflict
          description: A resource with this name already exists
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    put:
      operationId: api_v3_company_workspaces_members_update
      description: |-
        ⚠️ **ALPHA ENDPOINT** - This endpoint is in alpha and subject to breaking changes. Use with caution in production environments.

        Add a new member (user or group) to a custom workspace. This endpoint can only be used by company level admins.
      summary: Bulk replace workspace members
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      tags:
      - Workspaces
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InstanceWorkspaceAddMemberV3Request'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/InstanceWorkspaceAddMemberV3Request'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/InstanceWorkspaceAddMemberV3Request'
        required: true
      security:
      - bearerAuth: []
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceMembersV3Response'
          description: ''
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/workspaces/{id}/members/groups/{group_id}:
    delete:
      operationId: api_v3_company_workspaces_members_groups_destroy
      description: |-
        ⚠️ **ALPHA ENDPOINT** - This endpoint is in alpha and subject to breaking changes. Use with caution in production environments.

        Remove a group from a custom workspace of the authenticated user's company. This endpoint can only be used by company-level admins or higher.
      summary: Remove a group from a workspace of your company
      parameters:
      - in: path
        name: group_id
        schema:
          type: integer
        required: true
      - in: path
        name: id
        schema:
          type: integer
        required: true
      tags:
      - Workspaces
      security:
      - bearerAuth: []
      - {}
      responses:
        '204':
          description: Group removed from workspace successfully
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: You do not have permission to perform this action.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Insufficient permissions
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: The requested resource was not found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not Found
          description: The requested resource was not found
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/workspaces/{id}/members/users/{user_id}:
    delete:
      operationId: api_v3_company_workspaces_members_users_destroy
      description: |-
        ⚠️ **ALPHA ENDPOINT** - This endpoint is in alpha and subject to breaking changes. Use with caution in production environments.

        Remove a user from a custom workspace of the authenticated user's company. This endpoint can only be used by company-level admins or higher.
      summary: Remove a user from a workspace of your company
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: The unique identifier of the workspace.
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        description: The unique identifier of the user to remove from the workspace.
        required: true
      tags:
      - Workspaces
      security:
      - bearerAuth: []
      - {}
      responses:
        '204':
          description: User removed from workspace successfully
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: You do not have permission to perform this action.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Insufficient permissions
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: The requested resource was not found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not Found
          description: The requested resource was not found
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/users:
    get:
      operationId: api_v3_company_users_list
      description: |-
        ⚠️ **ALPHA ENDPOINT** - This endpoint is in alpha and subject to breaking changes. Use with caution in production environments.

        Get the list of all users in your company. This endpoint is available to company-level and instance-level administrators.
      summary: List company users
      parameters:
      - in: query
        name: group_id
        schema:
          type: integer
      - in: query
        name: is_active
        schema:
          type: boolean
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      tags:
      - Users
      security:
      - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCompanyUserV3ResponseList'
          description: Paginated list of users in the authenticated user's company.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: You do not have permission to perform this action.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Insufficient permissions
        '404':
          description: Not Found - group does not exist or belongs to another company.
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/groups:
    get:
      operationId: api_v3_company_groups_list
      description: |-
        List the groups in your company. This endpoint is available to company-level and instance-level administrators.

        Results are scoped to the authenticated user's company and can be filtered by name (case-insensitive contains), category, and membership (`user_id`). Supports pagination.
      summary: List the groups in your company
      parameters:
      - in: query
        name: ordering
        schema:
          type: string
          enum:
          - -created_at
          - -name
          - -updated_at
          - created_at
          - name
          - updated_at
        description: Order the results by `name`, `created_at` or `updated_at`. Prefix
          the field with `-` for descending order (e.g. `-created_at`). Defaults to
          `name`; entries sharing a name are ordered newest-first.
      - name: page
        required: false
        in: query
        description: A page number within the paginated result set.
        schema:
          type: integer
      - name: page_size
        required: false
        in: query
        description: Number of results to return per page.
        schema:
          type: integer
      tags:
      - User Groups
      security:
      - bearerAuth: []
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCompanyGroupResponseList'
          description: Paginated list of groups in the user's company
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: You do not have permission to perform this action.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Insufficient permissions
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    post:
      operationId: api_v3_company_groups_create
      description: Create a new custom group in your company. This endpoint is available
        to company-level and instance-level administrators.
      summary: Create a new custom group in your company
      tags:
      - User Groups
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCompanyGroupRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateCompanyGroupRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateCompanyGroupRequest'
        required: true
      security:
      - bearerAuth: []
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyGroupResponse'
          description: Group created successfully
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: You do not have permission to perform this action.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Insufficient permissions
        '409':
          description: Conflict - A group with this name already exists in the company
            (active or soft-deleted)
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/groups/{id}:
    get:
      operationId: api_v3_company_groups_retrieve
      description: Retrieve the information of a group in your company. This endpoint
        is available to company-level and instance-level administrators.
      summary: Retrieve the information of a group in your company
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      tags:
      - User Groups
      security:
      - bearerAuth: []
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyGroupResponse'
          description: Group details
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: You do not have permission to perform this action.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Insufficient permissions
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: The requested resource was not found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not Found
          description: The requested resource was not found
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    patch:
      operationId: api_v3_company_groups_partial_update
      description: Partially update a custom group in your company. This endpoint
        is available to company-level and instance-level administrators.
      summary: Partially update a custom group in your company
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      tags:
      - User Groups
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPatchGroupRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPatchGroupRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPatchGroupRequest'
      security:
      - bearerAuth: []
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyGroupResponse'
          description: Group updated successfully
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          description: Unauthorized - Insufficient permissions or non-custom group
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: The requested resource was not found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not Found
          description: The requested resource was not found
        '409':
          description: Conflict - A group with this name already exists in the company
            (active or soft-deleted)
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    delete:
      operationId: api_v3_company_groups_destroy
      description: Delete a custom group in your company. This endpoint is available
        to company-level and instance-level administrators.
      summary: Delete a custom group in your company
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      tags:
      - User Groups
      security:
      - bearerAuth: []
      - {}
      responses:
        '204':
          description: Group deleted successfully
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          description: Unauthorized - Insufficient permissions or non-custom group
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: The requested resource was not found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not Found
          description: The requested resource was not found
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/groups/{id}/members:
    get:
      operationId: api_v3_company_groups_members_retrieve
      description: Get the list of members for a group in your company. This endpoint
        is available to company-level and instance-level administrators.
      summary: Get the list of members for a group
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      tags:
      - User Groups
      security:
      - bearerAuth: []
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupMembersResponse'
          description: List of group members with their roles
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: You do not have permission to perform this action.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Insufficient permissions
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: The requested resource was not found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not Found
          description: The requested resource was not found
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    post:
      operationId: api_v3_company_groups_members_create
      description: |+
        Add a new member to a custom group in your company. This endpoint is available to company-level and instance-level administrators.

      summary: Add a member to a custom group
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      tags:
      - User Groups
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddGroupMemberRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/AddGroupMemberRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/AddGroupMemberRequest'
        required: true
      security:
      - bearerAuth: []
      - {}
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupMembersResponse'
          description: Member added successfully. Returns all group members with their
            roles.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          description: Unauthorized - Insufficient permissions or non-custom group
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: The requested resource was not found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not Found
          description: The requested resource was not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Conflict:
                  value:
                    id: null
                    code: 409
                    error: conflict
                    detail: A resource with this name already exists.
                    doc_url: https://developers.lighton.ai/errors#conflict
          description: A resource with this name already exists
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
    put:
      operationId: api_v3_company_groups_members_update
      description: |+
        Bulk replace the entire list of members for a custom group in your company. This endpoint is available to company-level and instance-level administrators.

        **Permissions:**
        - Sys Admin, Account Manager, Company Admin: Can replace members for custom groups
        - Only custom groups can be modified
        - All users must belong to the same company as the group

        **Behavior:**
        - Replaces ALL existing members with the provided list
        - An empty users array removes all members from the group
        - Each user must have both id and role fields
        - Valid roles: 'member' or 'owner'

      summary: Bulk replace all members for a custom group
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      tags:
      - User Groups
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplaceGroupMembersRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/ReplaceGroupMembersRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ReplaceGroupMembersRequest'
        required: true
      security:
      - bearerAuth: []
      - {}
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupMembersResponse'
          description: Members replaced successfully. Returns all group members with
            their roles.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          description: Unauthorized - Insufficient permissions or non-custom group
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                NotFound:
                  value:
                    id: null
                    code: 404
                    error: not_found
                    detail: The requested resource was not found.
                    doc_url: https://developers.lighton.ai/errors#not_found
                  summary: Not Found
          description: The requested resource was not found
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company/groups/{id}/members/users/{user_id}:
    delete:
      operationId: api_v3_company_groups_members_users_destroy
      description: Remove a user from a custom group in your company. This endpoint
        is available to company-level and instance-level administrators.
      summary: Remove a user from a custom group
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        required: true
      tags:
      - User Groups
      security:
      - bearerAuth: []
      - {}
      responses:
        '204':
          description: User removed successfully from the group
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          description: Unauthorized - Insufficient permissions or non-custom group
        '404':
          description: Not Found - Group not found, user not found, or user not a
            member of the group
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
  /api/v3/company:
    patch:
      operationId: api_v3_company_partial_update
      description: |-
        This endpoint partially updates the authenticated user's own company.

        It takes no company identifier — the company is resolved from the caller, so no other company can be addressed. Only the fields a Company Admin may change are accepted: `name`, the password policy (`min_password_length`, `max_password_length`), the Knowledge Graph toggles and telemetry consent (`is_telemetry_enabled`, `is_telemetry_ids_allowed`). Any other company field must be changed through the instance-level company endpoint.

        Fields outside that set are rejected rather than silently ignored.

        Access levels:
        - Company Admin: Can update their own company
        - SysAdmin/Account Manager: Can update their own company through this endpoint too, and any company through the instance-level endpoint

        Company name must be unique.
      summary: Partially update your company (PATCH)
      tags:
      - Companies
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedPatchOwnCompanyRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedPatchOwnCompanyRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedPatchOwnCompanyRequest'
      security:
      - bearerAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyDetailResponse'
          description: Company updated successfully
        '400':
          description: Domain rule violation (name forbidden by naming policy)
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Unauthorized:
                  value:
                    id: null
                    code: 401
                    error: unauthorized
                    detail: Authentication credentials were not provided or are invalid.
                    doc_url: https://developers.lighton.ai/errors#unauthorized
          description: Authentication credentials were not provided or are invalid
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Forbidden:
                  value:
                    id: null
                    code: 403
                    error: insufficient_permissions
                    detail: You do not have permission to perform this action.
                    doc_url: https://developers.lighton.ai/errors#insufficient_permissions
          description: Insufficient permissions
        '404':
          description: The caller is not attached to a company
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ErrorResponse'
              examples:
                Conflict:
                  value:
                    id: null
                    code: 409
                    error: conflict
                    detail: A resource with this name already exists.
                    doc_url: https://developers.lighton.ai/errors#conflict
          description: A resource with this name already exists
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIV3ValidationErrorResponse'
              examples:
                ValidationError:
                  value:
                    id: null
                    code: 422
                    error: validation_error
                    detail: One or more fields failed validation.
                    doc_url: https://developers.lighton.ai/errors#validation_error
                    fields:
                      <field_name>:
                      - error: required
                        detail: This field is required.
                  summary: Validation Error
          description: Request body is valid JSON but one or more fields failed validation
        '503':
          description: API is under maintenance. Check `GET /api/v3/system/status`
            for active periods and retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceMaintenance503'
components:
  schemas:
    APIV3ErrorResponse:
      type: object
      properties:
        id:
          type:
          - string
          - 'null'
          description: Job/resource id when one already exists (useful for async error
            diagnosis); null otherwise.
        code:
          type: integer
          description: HTTP status code
        error:
          type: string
          description: Error code used by the UI as a translation key
        detail:
          type: string
          description: Human-readable error message for developers
        doc_url:
          type: string
          description: Link to the error-code documentation page
      required:
      - code
      - detail
      - doc_url
      - error
      - id
    APIV3FieldError:
      type: object
      properties:
        error:
          type: string
          description: Error code / translation key
        detail:
          type: string
          description: Human-readable description of the field error
      required:
      - detail
      - error
    APIV3ValidationErrorResponse:
      type: object
      properties:
        id:
          type:
          - string
          - 'null'
          description: Job/resource id when one already exists (useful for async error
            diagnosis); null otherwise.
        code:
          type: integer
          description: HTTP status code
        error:
          type: string
          description: Error code used by the UI as a translation key
        detail:
          type: string
          description: Human-readable error message for developers
        doc_url:
          type: string
          description: Link to the error-code documentation page
        fields:
          type: object
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/APIV3FieldError'
          description: Field-level validation errors keyed by field name
      required:
      - code
      - detail
      - doc_url
      - error
      - id
    AddGroupMemberRequest:
      type: object
      description: 'V3 API: Add a single member to a group'
      properties:
        user_id:
          type: integer
          description: ID of the user to add to the group
        role:
          allOf:
          - $ref: '#/components/schemas/GroupMemberRoleEnum'
          description: |-
            Role of the user in the group (owner or member)

            * `owner` - owner
            * `member` - member
      required:
      - role
      - user_id
    BlankEnum:
      enum:
      - ''
    CompanyDetailResponse:
      type: object
      description: Serializer for detailed company view
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          description: The name of the company registered in the instance.
          maxLength: 255
        dpo_email:
          type:
          - string
          - 'null'
          format: email
          description: Contact email displayed in user profiles for data privacy inquiries.
          maxLength: 254
        max_users:
          type: integer
          maximum: 2147483647
          minimum: -2147483648
          description: Maximum allowed active users for this company license.
        allow_company_admins_to_manage_sso:
          type: boolean
          description: If the company admins of this company can create & manage their
            SSO configuration.
        auto_provision_external_users:
          type: boolean
          description: Automatically create user accounts when users log in via external
            auth (SSO/LDAP) for the first time.
        storage_limit_company_ws:
          type:
          - integer
          - 'null'
          maximum: 2147483647
          minimum: -2147483648
          description: Total storage ceiling for all workspace uploads combined (personal
            + all shared workspaces), in MB. Leave blank to use the default value.
            Use 0 to disable uploads.
        storage_limit_personal_ws:
          type:
          - integer
          - 'null'
          maximum: 2147483647
          minimum: -2147483648
          description: Limit for all combined personal workspaces in this company,
            in MB. Leave blank to use the default value. Use 0 to disable uploads.
        storage_limit_custom_ws:
          type:
          - integer
          - 'null'
          maximum: 2147483647
          minimum: -2147483648
          description: Limit for all combined shared workspaces in this company (including
            the company workspace), in MB. Leave blank to use the default value. Use
            0 to disable uploads.
        created_at:
          type: string
          format: date-time
          readOnly: true
        login_method:
          allOf:
          - $ref: '#/components/schemas/LoginMethodEnum'
          description: |-
            Authentication method(s) allowed for users in this company.

            * `password` - Password
            * `sso` - Single Sign On
            * `ldap` - LDAP
        min_password_length:
          type:
          - integer
          - 'null'
          maximum: 32767
          minimum: 0
          description: Minimum password length for users in this company. Leave blank
            to use the platform default (8 characters).
        max_password_length:
          type:
          - integer
          - 'null'
          maximum: 32767
          minimum: 0
          description: Maximum password length for users in this company. Leave blank
            to use the platform default (128 characters).
        kg_tags_enabled:
          type: boolean
          description: Enable automatic document tagging using Knowledge Graph. Disabling
            this prevents token consumption for LLM-based tagging. Global setting
            must also be enabled.
        kg_summaries_enabled:
          type: boolean
          description: Enable automatic document summarization using Knowledge Graph.
            Disabling this prevents token consumption for LLM-based summaries. Global
            setting must also be enabled.
        kg_queries_enabled:
          type: boolean
          description: Enable automatic query suggestion generation using Knowledge
            Graph. Disabling this prevents token consumption for LLM-based query suggestions.
            Global setting must also be enabled.
        tier:
          allOf:
          - $ref: '#/components/schemas/TierEnum'
          description: |-
            Commercial tier for this company. Drives entitlements and billing posture.

            * `free` - Free
            * `pay-as-you-go` - Pay-as-you-go
            * `business` - Business
        is_telemetry_enabled:
          type: boolean
          title: Technical telemetry enabled
          description: If technical telemetry is enabled for this company. No user
            data is collected.
        is_telemetry_ids_allowed:
          type: boolean
          title: Technical telemetry IDs allowed
          description: Include company and user IDs in telemetry. Allows telemetry
            to be more useful for troubleshooting.
      required:
      - allow_company_admins_to_manage_sso
      - created_at
      - id
      - name
    CompanyGroupResponse:
      type: object
      description: |-
        Company group create / retrieve / update / list.

        ``user_role`` is empty for a freshly created group because the creator is not automatically
        added as a member.
      properties:
        id:
          type: integer
        name:
          type: string
        category:
          type: string
        description:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        user_role:
          type: string
          readOnly: true
        members_count:
          type: integer
          readOnly: true
      required:
      - category
      - created_at
      - description
      - id
      - members_count
      - name
      - updated_at
      - user_role
    CompanyMetricsResponse:
      type: object
      properties:
        workspaces:
          type: integer
          description: Number of workspaces in the company.
        indexed_files:
          type: integer
          description: Number of documents in the company that finished indexing (embedded).
        retrieval_calls_30d:
          type: integer
          description: Search + ask (RAG) calls across the company's API keys over
            the last 30 days.
        top_workspaces:
          type: array
          items:
            $ref: '#/components/schemas/WorkspaceFileCount'
          description: Up to the 5 workspaces with the most indexed documents, largest
            first.
        other_files:
          type: integer
          description: Indexed documents held by all workspaces beyond the top 5 (the
            'Others' bucket).
      required:
      - indexed_files
      - other_files
      - retrieval_calls_30d
      - top_workspaces
      - workspaces
    CompanyModelConfig:
      description: |-
        Serialized company model configuration for export/import.

        API keys are never included. Import is idempotent: existing assignments are skipped.
      properties:
        version:
          default: 1
          description: Config format version.
          title: Version
          type: integer
        assigned_models:
          description: Models assigned to the company.
          items:
            $ref: '#/components/schemas/CompanyModelEntry'
          title: Assigned Models
          type: array
      title: CompanyModelConfig
      type: object
    CompanyModelConfigImportResultResponse:
      description: 'Outcome of an import: which models were newly assigned, already
        assigned, or unresolvable.'
      properties:
        assigned:
          description: Technical names newly assigned to the company.
          items:
            type: string
          title: Assigned
          type: array
        skipped:
          description: Technical names already assigned — left untouched.
          items:
            type: string
          title: Skipped
          type: array
        errors:
          description: Entries that could not be resolved, with a reason.
          items:
            type: string
          title: Errors
          type: array
      title: CompanyModelConfigImportResultResponse
      type: object
    CompanyModelEntry:
      properties:
        uuid:
          description: Paradigm UUID of the model.
          format: uuid
          title: Uuid
          type: string
        technical_name:
          description: Technical name of the model in LiteLLM.
          title: Technical Name
          type: string
        is_default:
          default: false
          description: Whether this is the default model for the company.
          title: Is Default
          type: boolean
      required:
      - uuid
      - technical_name
      title: CompanyModelEntry
      type: object
    CompanyUserV3Response:
      type: object
      properties:
        id:
          type: integer
        username:
          type: string
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
      required:
      - email
      - first_name
      - id
      - last_name
      - username
    CompanyWorkspaceCreateV3Request:
      type: object
      description: V3 Request serializer for creating a workspace in the user's company.
      properties:
        name:
          type: string
          maxLength: 100
        description:
          type: string
          default: ''
      required:
      - name
    CompanyWorkspaceV3DetailsResponse:
      type: object
      description: V3 Response serializer for company workspace creation and retrieval.
      properties:
        id:
          type: integer
        name:
          type: string
        workspace_type:
          type: string
        document_upload_method:
          type: string
        description:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        files_count:
          type: integer
        user_role:
          readOnly: true
          oneOf:
          - $ref: '#/components/schemas/UserRoleEnum'
          - $ref: '#/components/schemas/BlankEnum'
        used_storage:
          type: number
          format: double
        sync:
          oneOf:
          - $ref: '#/components/schemas/WorkspaceSync'
          - type: 'null'
          readOnly: true
        scoped_api_keys:
          type: array
          items:
            $ref: '#/components/schemas/WorkspaceScopedAPIKey'
          readOnly: true
      required:
      - created_at
      - description
      - document_upload_method
      - files_count
      - id
      - name
      - scoped_api_keys
      - sync
      - updated_at
      - used_storage
      - user_role
      - workspace_type
    CompanyWorkspaceV3ListResponse:
      type: object
      description: V3 Response serializer for company-level workspaces endpoint.
      properties:
        id:
          type: integer
        name:
          type: string
        workspace_type:
          type: string
        document_upload_method:
          type: string
        description:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        files_count:
          type: integer
        user_role:
          readOnly: true
          oneOf:
          - $ref: '#/components/schemas/UserRoleEnum'
          - $ref: '#/components/schemas/BlankEnum'
        sync:
          oneOf:
          - $ref: '#/components/schemas/WorkspaceSync'
          - type: 'null'
          readOnly: true
      required:
      - created_at
      - description
      - document_upload_method
      - files_count
      - id
      - name
      - sync
      - updated_at
      - user_role
      - workspace_type
    CreateCompanyGroupRequest:
      type: object
      description: 'V3 API: Create a new custom group in the user''s company'
      properties:
        name:
          type: string
          description: Name of the group
          maxLength: 254
        description:
          type:
          - string
          - 'null'
          description: Description of the group
      required:
      - name
    CustomMLModelCreateRequest:
      type: object
      properties:
        name:
          type: string
          description: Display name, unique within the company.
        litellm_model:
          type: string
          description: LiteLLM model string, e.g. 'openai/gpt-4-turbo' or 'azure/my-deployment'.
        model_type:
          type: string
          default: Large Language Model
          description: Model type (e.g. 'Large Language Model', 'Embedding Model').
        endpoint:
          type:
          - string
          - 'null'
          description: Custom API base URL (api_base in LiteLLM).
        api_key:
          type:
          - string
          - 'null'
          description: API key for the custom model endpoint.
        temperature:
          type:
          - number
          - 'null'
          format: double
          maximum: 2
          minimum: 0
          description: Sampling temperature to use for every request to this model.
            Omit to let each calling feature use its own value. Models that accept
            only one temperature are set to it regardless of what is submitted here.
      required:
      - litellm_model
      - name
    CustomMLModelResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique ID for this custom model.
        name:
          type: string
          description: Display name, unique within the company.
        technical_name:
          type: string
          description: LiteLLM identifier (custom-{uuid}).
        litellm_model:
          type: string
          description: LiteLLM model string, e.g. 'openai/gpt-4-turbo'.
        model_type:
          type: string
          description: Model type.
        endpoint:
          type:
          - string
          - 'null'
          description: Custom API base URL.
        enabled:
          type: boolean
          description: Whether the model is active.
        is_default:
          type: boolean
          description: Whether this is the company's default custom model.
        temperature:
          type:
          - number
          - 'null'
          format: double
          description: Sampling temperature sent for every request to this model.
            Null means no temperature is configured and the calling feature's own
            value is used.
        required_temperature:
          type:
          - number
          - 'null'
          format: double
          description: The only temperature this model accepts, when it accepts exactly
            one. Set for models that have removed sampling parameters; null for every
            other model.
        max_temperature:
          type:
          - number
          - 'null'
          format: double
          description: Highest temperature this model's provider accepts. Null for
            a model served from its own endpoint, where no provider bound applies.
      required:
      - enabled
      - id
      - is_default
      - litellm_model
      - model_type
      - name
      - technical_name
    ExternalAPIKeyResponse:
      type: object
      description: Response serializer — never returns the key value.
      properties:
        id:
          type: integer
        provider:
          type: string
        label:
          type: string
        is_active:
          type: boolean
        created_at:
          type: string
          format: date-time
        scope:
          type: string
          readOnly: true
      required:
      - created_at
      - id
      - is_active
      - label
      - provider
      - scope
    GroupMember:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        role:
          type: string
      required:
      - id
      - name
      - role
    GroupMemberResponse:
      type: object
      description: 'A single group member: id, email, and role.'
      properties:
        id:
          type: integer
        email:
          type: string
          description: Read the email from the prefetched ``EmailAddress`` to avoid
            N+1 queries.
          readOnly: true
        role:
          type: string
      required:
      - email
      - id
      - role
    GroupMemberRoleEnum:
      enum:
      - owner
      - member
      type: string
      description: |-
        * `owner` - owner
        * `member` - member
    GroupMembersResponse:
      type: object
      description: 'The members of a group: ``{"users": [{id, email, role}, ...]}``.'
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/GroupMemberResponse'
          readOnly: true
      required:
      - users
    InstanceWorkspaceAddMemberV3Request:
      type: object
      description: 'V3 API: Request serializer for adding a member to a workspace
        (admin-only endpoint)'
      properties:
        user_id:
          type: integer
        group_id:
          type: integer
        role:
          $ref: '#/components/schemas/InstanceWorkspaceAddMemberV3RequestRoleEnum'
      required:
      - role
    InstanceWorkspaceAddMemberV3RequestRoleEnum:
      enum:
      - owner
      - editor
      - viewer
      type: string
      description: |-
        * `owner` - Owner
        * `editor` - Editor
        * `viewer` - Viewer
    LoginMethodEnum:
      enum:
      - password
      - sso
      - ldap
      type: string
      description: |-
        * `password` - Password
        * `sso` - Single Sign On
        * `ldap` - LDAP
    PaginatedCompanyGroupResponseList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/CompanyGroupResponse'
    PaginatedCompanyUserV3ResponseList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/CompanyUserV3Response'
    PaginatedCompanyWorkspaceV3ListResponseList:
      type: object
      required:
      - count
      - results
      properties:
        count:
          type: integer
          example: 123
        next:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=4
        previous:
          type: string
          nullable: true
          format: uri
          example: http://api.example.org/accounts/?page=2
        results:
          type: array
          items:
            $ref: '#/components/schemas/CompanyWorkspaceV3ListResponse'
    PatchedCompanyWorkspaceUpdateV3Request:
      type: object
      description: V3 Request serializer for updating a workspace in the user's company.
      properties:
        name:
          type: string
          maxLength: 100
        description:
          type: string
        datasource:
          type: object
          additionalProperties: {}
          description: 'Datasource configuration to convert this workspace into a
            read-only synced workspace. Company admin only. Cannot be undone. Fields:
            type (googledrive|sharepoint|servicenow|webscrapper), name, credentials,
            filter_criteria.'
    PatchedCustomMLModelUpdateRequest:
      type: object
      properties:
        name:
          type:
          - string
          - 'null'
          description: Display name, unique within the company.
        is_default:
          type:
          - boolean
          - 'null'
          description: Set to true to mark this as the company's default custom model.
        temperature:
          type:
          - number
          - 'null'
          format: double
          maximum: 2
          minimum: 0
          description: Sampling temperature to use for every request to this model.
            A model that accepts only one temperature keeps that one whatever is submitted
            here.
    PatchedPatchGroupRequest:
      type: object
      description: 'V3 API: Partially update an existing user group (PATCH) - all
        fields optional'
      properties:
        name:
          type: string
          description: Name of the group
          maxLength: 254
        description:
          type:
          - string
          - 'null'
          description: Description of the group
    PatchedPatchOwnCompanyRequest:
      type: object
      properties:
        name:
          type: string
          description: Company name (max 32 characters, alphanumeric + spaces/hyphens/underscores)
          pattern: ^[a-zA-Z0-9 \-_]+$
          maxLength: 32
        min_password_length:
          type:
          - integer
          - 'null'
          minimum: 1
          description: Minimum password length. Null uses the platform default (8).
        max_password_length:
          type:
          - integer
          - 'null'
          minimum: 1
          description: Maximum password length. Null imposes no upper limit.
        kg_tags_enabled:
          type: boolean
          description: Enable automatic document tagging using Knowledge Graph (requires
            global setting also enabled)
        kg_summaries_enabled:
          type: boolean
          description: Enable automatic document summarization using Knowledge Graph
            (requires global setting also enabled)
        kg_queries_enabled:
          type: boolean
          description: Enable automatic query suggestion generation using Knowledge
            Graph (requires global setting also enabled)
        is_telemetry_enabled:
          type: boolean
          description: Whether this company allows sending technical telemetry data.
            No user content is ever collected. Viewable by company admins and DPOs;
            editable by company admins and instance-level administrators only.
        is_telemetry_ids_allowed:
          type: boolean
          description: Whether company and user IDs may be included in technical telemetry
            data. Only meaningful when is_telemetry_enabled is true.
    ProviderCatalogEntryResponse:
      type: object
      properties:
        litellm_model:
          type: string
          description: LiteLLM model string to submit as `litellm_model` when creating
            the custom model.
        label:
          type: string
          description: The provider's own model identifier, for display in a picker.
        model_type:
          type: string
          description: Model type this entry can be registered as.
        max_input_tokens:
          type:
          - integer
          - 'null'
          description: Context window in tokens, when the provider publishes one.
        required_temperature:
          type:
          - number
          - 'null'
          format: double
          description: The only temperature this model accepts, when it accepts exactly
            one. Offer it as the temperature for this model; null means any value
            within the range is fine.
        max_temperature:
          type:
          - number
          - 'null'
          format: double
          description: Highest temperature this provider accepts. Null when the provider
            publishes no bound.
      required:
      - label
      - litellm_model
      - model_type
    ReplaceGroupMemberItem:
      type: object
      description: Serializer for a single member in replace group members request
      properties:
        id:
          type: integer
          description: ID of the user
        role:
          allOf:
          - $ref: '#/components/schemas/GroupMemberRoleEnum'
          description: |-
            Role of the member in the group (owner or member)

            * `owner` - owner
            * `member` - member
      required:
      - id
      - role
    ReplaceGroupMembersRequest:
      type: object
      description: 'V3 API: Bulk replace all group members'
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/ReplaceGroupMemberItem'
          description: List of users with their roles. An empty array removes all
            members from the group.
      required:
      - users
    ScopeTypeEnum:
      enum:
      - workspace
      - global
      type: string
      description: |-
        * `workspace` - workspace
        * `global` - global
    SetExternalAPIKeyRequest:
      type: object
      properties:
        key:
          type: string
          description: Provider API key (e.g. sk-... for OpenAI). Stored encrypted
            — never returned in responses.
          maxLength: 512
        label:
          type: string
          default: ''
          description: Optional human-readable label (e.g. 'Production key').
          maxLength: 64
      required:
      - key
    StandardWorkspaceDatasourceV3Request:
      description: Pydantic request model for datasource conversion and credential
        testing.
      properties:
        type:
          allOf:
          - $ref: '#/components/schemas/TypeEnum'
          title: Type
        name:
          title: Name
          type: string
        credentials:
          additionalProperties: true
          default: {}
          title: Credentials
          type: object
        filter_criteria:
          additionalProperties: true
          default: {}
          title: Filter Criteria
          type: object
      required:
      - type
      - name
      title: StandardWorkspaceDatasourceV3Request
      type: object
    TierEnum:
      enum:
      - free
      - pay-as-you-go
      - business
      type: string
      description: |-
        * `free` - Free
        * `pay-as-you-go` - Pay-as-you-go
        * `business` - Business
    TypeEnum:
      enum:
      - googledrive
      - sharepoint
      - servicenow
      - webscrapper
      type: string
    UserMember:
      type: object
      properties:
        id:
          type: integer
        email:
          type: string
          description: Get email from prefetched EmailAddress to avoid N+1 queries.
          readOnly: true
        role:
          type: string
      required:
      - email
      - id
      - role
    UserRoleEnum:
      enum:
      - owner
      - editor
      - viewer
      type: string
      description: "* `owner` - owner\n* `editor` - editor\n* `viewer` - viewer\n\
        * `` - "
    WorkspaceFileCount:
      type: object
      properties:
        name:
          type: string
          description: Workspace name.
        files:
          type: integer
          description: Number of indexed (embedded) documents in the workspace.
      required:
      - files
      - name
    WorkspaceMembersV3Response:
      type: object
      description: V3 Response serializer for workspace members.
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/UserMember'
        groups:
          type: array
          items:
            $ref: '#/components/schemas/GroupMember'
      required:
      - groups
      - users
    WorkspaceScopedAPIKey:
      type: object
      description: |-
        An API key that can access a single workspace, seen from the workspace side.

        Covers both keys explicitly scoped to the workspace (`scope_type="workspace"`,
        each carrying its per-workspace role) and the requesting user's globally-scoped
        keys (`scope_type="global"`), which implicitly reach every workspace in the
        company with the user's own role here. Reads flat dicts built by
        `WorkspaceScopedAPIKeysMixin`, which lists explicitly-scoped keys first.
      properties:
        id:
          type: string
        name:
          type: string
        prefix:
          type: string
        role:
          type: string
        created_at:
          type: string
          format: date-time
        created_by:
          type: string
        scope_type:
          $ref: '#/components/schemas/ScopeTypeEnum'
      required:
      - created_at
      - created_by
      - id
      - name
      - prefix
      - role
      - scope_type
    WorkspaceSync:
      type: object
      properties:
        datasource_type:
          type: string
        source_name:
          type: string
        last_status:
          type: string
        updated_at:
          type:
          - string
          - 'null'
          format: date-time
        failed_files_count:
          type: integer
        next_import_date:
          type:
          - string
          - 'null'
          format: date-time
        editable:
          type: boolean
        name:
          type: string
        instance_url:
          type:
          - string
          - 'null'
        tenant_id:
          type: string
        site_name:
          type: string
        client_id:
          type: string
        filter_criteria: {}
      required:
      - client_id
      - datasource_type
      - editable
      - failed_files_count
      - filter_criteria
      - instance_url
      - last_status
      - name
      - next_import_date
      - site_name
      - source_name
      - tenant_id
      - updated_at
    ServiceMaintenance503:
      type: object
      description: Returned by the maintenance middleware when the requested endpoint
        is blocked.
      required:
      - detail
      - error
      - mode
      properties:
        detail:
          type: string
          example: System is under maintenance.
        error:
          type: string
          example: service_maintenance
        mode:
          type: string
          enum:
          - full_shutdown
          - warning_banner
          description: '`full_shutdown` blocks all traffic; `warning_banner` also
            blocks and shows a dismissible toast.'
        reason:
          type: string
          description: Operator-supplied maintenance reason, if any.
        started_at:
          type: string
          format: date-time
        endpoint_category_names:
          type: array
          items:
            type: string
          description: Non-empty only for category-scoped periods. Empty means all
            endpoints are affected.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.
servers:
- url: https://paradigm.lighton.ai
tags:
- name: Models
  description: Operations about AI models
- name: Workspaces
  description: Operations about workspaces
- name: Users
  description: Operations about users
- name: User Groups
  description: Operations about user groups
- name: Companies
  description: Operations about companies
