openapi: 3.0.0
paths:
  /api/data-marts/data-quality/runs/batch:
    post:
      operationId: DataQualityBatchController_runBatch
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchRunDataQualityRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchRunDataQualityResponseApiDto'
        '400':
          description: Batch request failed validation
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Independently enqueue Data Quality runs for selected Data Marts
      tags:
        - Data Quality
  /api/data-marts/data-quality/summaries:
    post:
      operationId: DataQualityBatchController_getSummaries
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetDataQualitySummariesRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDataQualitySummariesResponseApiDto'
        '400':
          description: Summary request failed validation
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Get compact Data Quality summaries for Data Marts
      tags:
        - Data Quality
  /api/data-marts/{dataMartId}/data-quality/config:
    get:
      operationId: DataQualityController_getConfig
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: Data Mart id
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataQualityConfigResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: |-
            SEE access is required

            Forbidden. Required role: Business User
        '404':
          description: Data Mart was not found in the current project
      security:
        - X-OWOX-Authorization: []
      summary: Get the effective Data Quality configuration
      tags:
        - Data Quality
    put:
      operationId: DataQualityController_replaceConfig
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: Data Mart id
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/DataQualityConfigValueApiDto'
                - type: 'null'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataQualityConfigResponseApiDto'
        '400':
          description: Configuration failed validation
        '401':
          description: Authentication required
        '403':
          description: |-
            EDIT access is required

            Forbidden. Required role: Data Owner
        '404':
          description: Data Mart was not found in the current project
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Replace or reset the Data Quality configuration
      tags:
        - Data Quality
  /api/data-marts/{dataMartId}/data-quality/runs:
    post:
      operationId: DataQualityController_run
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: Data Mart id
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunDataQualityRequestApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunDataQualityResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: |-
            EDIT access is required

            Forbidden. Required role: Data Owner
        '404':
          description: Data Mart was not found in the current project
        '409':
          description: Data Mart is ineligible or already has an active run
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Run Data Quality using the saved configuration
      tags:
        - Data Quality
  /api/data-marts/{dataMartId}/data-quality/runs/latest:
    get:
      operationId: DataQualityController_getLatest
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: Data Mart id
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/LatestDataQualityRunResponseApiDto'
                  - type: 'null'
        '401':
          description: Authentication required
        '403':
          description: |-
            SEE access is required

            Forbidden. Required role: Business User
        '404':
          description: Data Mart was not found in the current project
      security:
        - X-OWOX-Authorization: []
      summary: Get the latest compact Data Quality run
      tags:
        - Data Quality
  /api/data-marts/runs:
    get:
      description: >-
        Returns newest-first runs for Data Marts visible to the current project
        member. Viewer access is required.
      operationId: ProjectDataMartRunsController_list
      parameters:
        - name: limit
          required: false
          in: query
          description: >-
            Maximum page size. Values default to 100 when absent, non-finite, or
            non-positive; finite fractions are floored and values above 100 are
            capped at 100.
          schema:
            type: number
            default: 100
        - name: offset
          required: false
          in: query
          description: >-
            Number of newest runs to skip. Values default to 0 when absent,
            non-finite, or non-positive; finite fractions are floored and values
            above 100,000 are capped at 100,000.
          schema:
            type: number
            default: 0
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Project-visible Data Mart runs in newest-first order.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectDataMartRunsResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get project DataMart run history
      tags:
        - Run History
  /api/data-marts/scheduled-triggers:
    get:
      operationId: ProjectScheduledTriggersController_list
      parameters:
        - name: limit
          required: false
          in: query
          description: Maximum number of triggers to return. Defaults to 100; max 100.
          schema:
            type: number
        - name: offset
          required: false
          in: query
          description: Number of triggers to skip. Defaults to 0.
          schema:
            type: number
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Project scheduled triggers visible to the current user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectScheduledTriggersResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List scheduled triggers across accessible Data Marts in the project
      tags:
        - ScheduledTriggers
  /api/data-marts/insight-templates:
    get:
      operationId: ProjectInsightTemplatesController_list
      parameters:
        - name: limit
          required: false
          in: query
          description: >-
            Maximum number of insight templates to return. Defaults to 100; max
            100.
          schema:
            type: number
        - name: offset
          required: false
          in: query
          description: Number of insight templates to skip. Defaults to 0.
          schema:
            type: number
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Project insight templates visible to the current user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectInsightTemplatesResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List insight templates across accessible Data Marts in the project
      tags:
        - Insights
  /api/reports:
    get:
      operationId: ProjectReportsController_list
      parameters:
        - name: ownerFilter
          required: false
          in: query
          description: Filter reports by whether they have owners
          schema:
            enum:
              - has_owners
              - no_owners
            type: string
        - name: limit
          required: false
          in: query
          description: >-
            Maximum number of reports to return. When omitted, the legacy
            unpaginated response is returned.
          schema:
            type: number
        - name: offset
          required: false
          in: query
          description: Number of reports to skip when limit or offset pagination is used.
          schema:
            type: number
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: List of reports for the project
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReportResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get all reports for a project
      tags:
        - Reports
    post:
      operationId: ReportController_create
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - title
                - dataMartId
                - dataDestinationId
                - destinationConfig
              properties:
                title:
                  type: string
                  example: My Report
                dataMartId:
                  type: string
                  description: ID of the data mart
                dataDestinationId:
                  type: string
                  description: ID of the data destination
                destinationConfig:
                  description: Configuration for the selected data destination.
                  oneOf:
                    - $ref: '#/components/schemas/ReportEmailDestinationConfigApiDto'
                    - allOf:
                        - $ref: '#/components/schemas/ReportLegacyEmailDestinationConfigApiDto'
                      not:
                        required:
                          - templateSource
                    - $ref: '#/components/schemas/ReportGoogleSheetsDestinationConfigApiDto'
                    - $ref: '#/components/schemas/ReportLookerStudioDestinationConfigApiDto'
                ownerIds:
                  type: array
                  items:
                    type: string
                  maxItems: 100
                columnConfig:
                  type: array
                  nullable: true
                  items:
                    type: string
                    minLength: 1
                    description: Selected output column name.
                  description: >-
                    Ordered selected output column names. Set null to include
                    all native columns.
                  example:
                    - date
                    - campaign_name
                    - spend
                filterConfig:
                  type: array
                  nullable: true
                  maxItems: 50
                  items:
                    $ref: '#/components/schemas/ReportFilterRuleApiDto'
                  description: >-
                    Output filters. Use placement=pre-join for slice filters
                    (column = unified blended identifier).
                sortConfig:
                  type: array
                  nullable: true
                  maxItems: 10
                  items:
                    $ref: '#/components/schemas/ReportSortRuleApiDto'
                  description: Ordered sort rules. Earlier rules take precedence.
                  example:
                    - column: date
                      direction: desc
                limitConfig:
                  type: integer
                  nullable: true
                  minimum: 1
                  maximum: 10000000
                  description: >-
                    Maximum number of rows to return. Set null to return without
                    an explicit cap.
                  example: 1000
                aggregationConfig:
                  type: array
                  nullable: true
                  maxItems: 50
                  items:
                    $ref: '#/components/schemas/ReportAggregationRuleApiDto'
                  description: >-
                    Aggregation rules. Each non-aggregated selected column
                    becomes a grouping key.
                dateTruncConfig:
                  type: array
                  nullable: true
                  maxItems: 50
                  items:
                    $ref: '#/components/schemas/ReportDateTruncRuleApiDto'
                  description: >-
                    Date-trunc rules. A date/timestamp dimension is bucketed by
                    a calendar unit.
                uniqueCountConfig:
                  oneOf:
                    - type: boolean
                    - type: array
                      items:
                        type: string
                      maxItems: 50
                  nullable: true
                  description: >-
                    Unique Count sources. `true` (legacy) counts distinct
                    primary keys of the main Data Mart; an array lists source
                    alias paths, where an empty string denotes the main Data
                    Mart.
                autoAggregationOptOut:
                  type: array
                  nullable: true
                  maxItems: 500
                  items:
                    type: string
                  description: >-
                    Columns whose aggregation the analyst removed. While any of
                    them is selected, the report is never collapsed
                    automatically and returns its rows as stored. Omit to keep
                    the stored value.
      responses:
        '201':
          description: The report has been successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a new report
      tags:
        - Reports
  /api/data-marts:
    post:
      operationId: DataMartController_create
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDataMartRequestApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDataMartResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a new DataMart
      tags:
        - DataMarts
    get:
      description: >-
        Returns Data Marts visible to the current project member. Viewer access
        is required. Each response page contains at most 1000 items.
      operationId: DataMartController_list
      parameters:
        - name: offset
          required: false
          in: query
          description: Number of visible Data Marts to skip before returning the next page
          schema:
            minimum: 0
            default: 0
            type: integer
        - name: ownerFilter
          required: false
          in: query
          description: Filter by whether a Data Mart has Business Owners or Data Owners
          schema:
            type: string
            enum:
              - has_owners
              - no_owners
        - name: storageId
          required: false
          in: query
          description: Only Data Marts in this Storage
          schema:
            format: uuid
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: >-
            A page of visible Data Marts with the next offset when more items
            exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedDataMartsResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List visible Data Marts
      tags:
        - DataMarts
  /api/data-marts/by-connector/{connectorName}:
    get:
      description: Returns the connector Data Marts of the project that the member can see.
      operationId: DataMartController_listDataMartsByConnectorName
      parameters:
        - name: connectorName
          required: true
          in: path
          description: Connector name
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DataMartResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List DataMarts by connector name
      tags:
        - DataMarts
  /api/data-marts/member-ownership-warnings:
    get:
      operationId: DataMartController_getMemberOwnershipWarnings
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: >-
            Data Owner warnings for project members whose role makes ownership
            ineffective
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  required:
                    - userId
                    - warning
                  properties:
                    userId:
                      type: string
                      example: user-123
                    warning:
                      type: string
                      example: >-
                        Data Owner — requires the Data Owner role to be
                        effective
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
      security:
        - X-OWOX-Authorization: []
      summary: List member ownership warnings
      tags:
        - DataMarts
  /api/data-marts/ai-helper/availability:
    get:
      description: >-
        Returns { enabled: true } when AI keys are present and metadata
        generation is available; { enabled: false } otherwise. Frontend uses
        this to decide whether to render AI-helper buttons.
      operationId: DataMartController_getAiHelperAvailability
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartAiHelperAvailabilityResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Check whether the AI helper is configured on this deployment
      tags:
        - DataMarts
  /api/data-marts/{id}/input-source-change-impact:
    get:
      description: >-
        Returns how many relationships reference this DataMart in each
        direction, how many reports are built on it, and which SQL DataMarts
        reference it in their query, so the caller can show the blast radius of
        changing its input source or deleting it. Referencing DataMarts the
        caller cannot see are counted but not named.
      operationId: DataMartController_getInputSourceChangeImpact
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartInputSourceChangeImpactResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Count what depends on a DataMart before its input source is changed
      tags:
        - DataMarts
  /api/data-marts/{id}/member-access:
    get:
      description: >-
        Returns every project member with their place in this DataMart's
        Ownership and whether they may take each group of actions on it — See
        and Use; Edit, Delete and Manage Triggers; Configure Sharing and Manage
        Owners — with the rule that decides each: role, ownership, sharing, or
        the member's contexts. MCP additionally lists only published DataMarts.
      operationId: DataMartController_getMemberAccess
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartMemberAccessResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
      security:
        - X-OWOX-Authorization: []
      summary: List what each project member can do with a DataMart, and why
      tags:
        - DataMarts
  /api/data-marts/{id}:
    get:
      operationId: DataMartController_get
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get a DataMart by ID
      tags:
        - DataMarts
    delete:
      operationId: DataMartController_delete
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: DataMart deleted
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Soft delete DataMart
      tags:
        - DataMarts
  /api/data-marts/{id}/definition:
    put:
      operationId: DataMartController_updateDefinition
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDataMartDefinitionApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update DataMart definition
      tags:
        - DataMarts
  /api/data-marts/{id}/title:
    put:
      operationId: DataMartController_updateTitle
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDataMartTitleApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update DataMart title
      tags:
        - DataMarts
  /api/data-marts/{id}/description:
    put:
      operationId: DataMartController_updateDescription
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDataMartDescriptionApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update DataMart description
      tags:
        - DataMarts
  /api/data-marts/{id}/icon:
    put:
      operationId: DataMartController_updateIcon
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDataMartIconApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update DataMart icon
      tags:
        - DataMarts
  /api/data-marts/{id}/owners:
    put:
      operationId: DataMartController_updateOwners
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDataMartOwnersApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update DataMart owners
      tags:
        - DataMarts
  /api/data-marts/{id}/contexts:
    put:
      description: >-
        Data Owners may only attach contexts they themselves are bound to.
        Project Admins may attach any context.
      operationId: DataMartController_updateContexts
      parameters:
        - name: id
          required: true
          in: path
          description: Data Mart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEntityContextsRequestApiDto'
      responses:
        '200':
          description: Data Mart contexts updated
        '401':
          description: Authentication required
        '403':
          description: |-
            Caller is not allowed to attach one of the contexts

            Forbidden. Required role: Data Owner
        '404':
          description: Data Mart or Context not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Replace the contexts attached to a Data Mart
      tags:
        - DataMarts
  /api/data-marts/{id}/publish:
    put:
      operationId: DataMartController_publish
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Publish DataMart
      tags:
        - DataMarts
  /api/data-marts/{id}/manual-run:
    post:
      description: >-
        Starts a connector Data Mart run. Requires the Data Owner role and edit
        access to the Data Mart.
      operationId: DataMartController_manualRun
      parameters:
        - name: id
          required: true
          in: path
          description: Data Mart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunDataMartRequestApiDto'
      responses:
        '201':
          description: DataMart run created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunDataMartResponseApiDto'
        '400':
          description: >-
            Invalid payload, unsupported Data Mart type, or unpublished Data
            Mart
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '404':
          description: Data Mart not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Start a manual Data Mart run
      tags:
        - DataMarts
  /api/data-marts/{id}/runs/{runId}/cancel:
    post:
      description: >-
        Cancels an active connector, standard report, or Data Quality run.
        Requires the Data Owner role and edit access to the Data Mart.
      operationId: DataMartController_cancelRun
      parameters:
        - name: id
          required: true
          in: path
          description: Data Mart ID
          schema:
            type: string
        - name: runId
          required: true
          in: path
          description: Run ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '204':
          description: Data Mart run cancelled
        '400':
          description: The run type cannot be cancelled
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '404':
          description: Data Mart or run not found
        '409':
          description: The run is no longer active
      security:
        - X-OWOX-Authorization: []
      summary: Cancel a Data Mart run
      tags:
        - DataMarts
  /api/data-marts/{id}/validate-definition:
    post:
      operationId: DataMartController_validate
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartValidationResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Validate DataMart definition
      tags:
        - DataMarts
  /api/data-marts/{id}/schema:
    put:
      operationId: DataMartController_updateSchema
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDataMartSchemaApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateDataMartSchemaResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update DataMart schema
      tags:
        - DataMarts
  /api/data-marts/{id}/schema/validate-formula:
    post:
      description: >-
        Checks a single formula against the Data Mart it belongs to and returns
        every violation and advisory the schema save would raise for it — minus
        the warehouse dry run, which this endpoint never performs. Edit access
        to the Data Mart is required: this answers whether a save would be
        accepted, so it is available to whoever can make that save.
      operationId: DataMartController_validateFormula
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateFormulaApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateFormulaResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: |-
            No access to this Data Mart

            Forbidden. Required role: Data Owner
        '404':
          description: Data Mart not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Validate one calculated-field formula
      tags:
        - DataMarts
  /api/data-marts/{id}/blended-fields-config:
    put:
      operationId: DataMartController_updateBlendedFieldsConfig
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBlendedFieldsConfigApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update DataMart blended fields config
      tags:
        - DataMarts
  /api/data-marts/{id}/runs:
    get:
      description: >-
        Returns newest-first run history for one visible Data Mart. Business
        User access is required.
      operationId: DataMartController_getRunHistory
      parameters:
        - name: id
          required: true
          in: path
          description: Data Mart ID
          schema:
            type: string
        - name: limit
          required: false
          in: query
          description: Maximum number of runs to return. Defaults to 100 when omitted.
          schema:
            default: 100
            type: number
        - name: offset
          required: false
          in: query
          description: Number of runs to skip. Defaults to zero when omitted.
          schema:
            default: 0
            type: number
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Newest-first page of Data Mart runs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartRunsResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '404':
          description: Data Mart not found
      security:
        - X-OWOX-Authorization: []
      summary: List Data Mart runs
      tags:
        - DataMarts
  /api/data-marts/{id}/runs/{runId}:
    get:
      description: >-
        Returns one run belonging to a visible Data Mart, including Data Quality
        detail when applicable. Business User access is required.
      operationId: DataMartController_getRunById
      parameters:
        - name: id
          required: true
          in: path
          description: Data Mart ID
          schema:
            type: string
        - name: runId
          required: true
          in: path
          description: Run ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataMartRunDetailResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '404':
          description: Data Mart or run not found
      security:
        - X-OWOX-Authorization: []
      summary: Get a Data Mart run
      tags:
        - DataMarts
  /api/data-marts/data-last-updated/refresh:
    post:
      description: >-
        Measures live, against the warehouse, when the source tables behind each
        DataMart last changed, and persists what resolves as the last-known
        value. Ids sharing a storage are measured together, so that storage’s
        client is built once. Free of consumption; best effort — ids that could
        not be measured are simply absent from the response and keep their
        previous value.
      operationId: DataMartController_refreshDataLastUpdated
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefreshDataMartDataLastUpdatedRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDataMartDataLastUpdatedResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Refresh the Data Last Updated snapshot for one or more DataMarts
      tags:
        - DataMarts
  /api/data-marts/health-status:
    post:
      operationId: DataMartController_getBatchHealthStatus
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchDataMartHealthStatusRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchDataMartHealthStatusResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Batch get DataMart health status
      tags:
        - DataMarts
  /api/data-marts/{id}/availability:
    put:
      operationId: DataMartController_updateAvailability
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDataMartAvailabilityApiDto'
      responses:
        '204':
          description: DataMart availability updated
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update DataMart availability
      tags:
        - DataMarts
  /api/data-marts/{id}/blendable-schema:
    get:
      description: >-
        Returns native fields, blended fields pulled from joined DataMarts, and
        the list of available sources reachable via relationships.
      operationId: DataMartController_getBlendableSchema
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: includeDraftTargets
          required: false
          in: query
          schema:
            type: boolean
            default: false
          description: >-
            Include draft relationship targets and disconnected target fields
            for configuration. Reporting consumers should keep the default so
            only published targets and report-eligible fields are returned.
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlendableSchemaDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get blendable schema for a DataMart
      tags:
        - DataMarts
  /api/data-marts/{id}/connector-target-conflict:
    get:
      description: >-
        Compares the target name without quotes and brackets. BigQuery names
        keep their case; Snowflake upper-cases only an unquoted database,
        because the connector always quotes the schema and the table; other
        storages ignore case. The other Data Mart is named only when the caller
        can see it.
      operationId: DataMartController_getConnectorTargetConflict
      parameters:
        - name: id
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: fullyQualifiedName
          required: true
          in: query
          description: Fully qualified name of the connector target table
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectorTargetConflictResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: |-
            EDIT access is required

            Forbidden. Required role: Data Owner
        '404':
          description: Data Mart was not found in the current project
      security:
        - X-OWOX-Authorization: []
      summary: Check whether another Data Mart writes the same connector target table
      tags:
        - DataMarts
  /api/data-storages:
    get:
      operationId: DataStorageController_getAll
      parameters:
        - name: ownerFilter
          required: false
          in: query
          description: Filter Data Storages by whether they have owners
          schema:
            enum:
              - has_owners
              - no_owners
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DataStorageListResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get all Data Storages
      tags:
        - DataStorages
    post:
      operationId: DataStorageController_create
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDataStorageApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataStorageResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a new Data Storage
      tags:
        - DataStorages
  /api/data-storages/{id}:
    put:
      operationId: DataStorageController_update
      parameters:
        - name: id
          required: true
          in: path
          description: Data Storage ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDataStorageApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataStorageResponseApiDto'
        '400':
          description: >-
            Invalid config or failed access check; reusableCredentialId is null,
            sent with credentials, credentialId or sourceStorageId, or names a
            Credential that does not fit the Storage type or is disabled; or the
            request sends only those old fields
        '401':
          description: Authentication required
        '403':
          description: >-
            No EDIT on the Storage, no USE on the Credential, or a
            plugin-authenticated request that sends reusableCredentialId


            Forbidden. Required role: Data Owner
        '404':
          description: Storage or Credential not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update Data Storage by ID
      tags:
        - DataStorages
    get:
      operationId: DataStorageController_get
      parameters:
        - name: id
          required: true
          in: path
          description: Data Storage ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataStorageResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get a Data Storage by ID
      tags:
        - DataStorages
    delete:
      operationId: DataStorageController_delete
      parameters:
        - name: id
          required: true
          in: path
          description: Data Storage ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Data Storage successfully deleted
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Delete Data Storage by ID
      tags:
        - DataStorages
  /api/data-storages/by-type/{type}:
    get:
      operationId: DataStorageController_getByType
      parameters:
        - name: type
          required: true
          in: path
          description: Data Storage type
          schema:
            enum:
              - GOOGLE_BIGQUERY
              - AWS_ATHENA
              - SNOWFLAKE
              - AWS_REDSHIFT
              - DATABRICKS
              - LEGACY_GOOGLE_BIGQUERY
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DataStorageByTypeResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List Data Storages by type (for credential copy)
      tags:
        - DataStorages
  /api/data-storages/{id}/resources:
    get:
      operationId: DataStorageController_listStorageResources
      parameters:
        - name: id
          required: true
          in: path
          description: Data Storage ID
          schema:
            type: string
        - name: level
          required: true
          in: query
          description: 'Tree level to load: namespaces | resources'
          schema:
            enum:
              - namespaces
              - resources
            type: string
        - name: namespaceId
          required: false
          in: query
          description: >-
            Top-level container ID (GCP project, Snowflake database, …).
            Required for level=resources.
          schema:
            example: my-gcp-project
            type: string
        - name: resourceType
          required: false
          in: query
          description: Filter leaf resources by type. Only applies to level=resources.
          schema:
            enum:
              - TABLE
              - VIEW
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListStorageResourcesResponseDto'
        '400':
          description: >-
            Resource browsing not supported for this storage type, or required
            params missing
        '401':
          description: Authentication required
        '403':
          description: |-
            No access to this Storage

            Forbidden. Required role: Business User
      security:
        - X-OWOX-Authorization: []
      summary: List storage resources (namespaces / leaf resources) for a storage
      tags:
        - DataStorages
  /api/data-storages/{id}/validate-access:
    post:
      operationId: DataStorageController_validate
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataStorageAccessValidationResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Validate Data Storage access
      tags:
        - DataStorages
  /api/data-storages/{id}/availability:
    put:
      operationId: DataStorageController_updateAvailability
      parameters:
        - name: id
          required: true
          in: path
          description: Data Storage ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateStorageAvailabilityApiDto'
      responses:
        '204':
          description: Data Storage availability updated
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update Data Storage availability
      tags:
        - DataStorages
  /api/data-destinations:
    post:
      operationId: DataDestinationController_create
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDataDestinationApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataDestinationResponseApiDto'
        '400':
          description: >-
            reusableCredentialId is null, missing where the type needs it, sent
            with credentials or for a type that takes no Credential, or names a
            Credential that does not fit the type or is disabled; or the request
            sends credentialId, sourceDestinationId, a Google Sheets key or a
            Google Chat webhook URL ("This page is out of date. Reload it.")
        '401':
          description: Authentication required
        '403':
          description: >-
            no USE on the Credential ("You cannot use this Credential."), or a
            plugin-authenticated request that sends reusableCredentialId


            Forbidden. Required role: Business User
        '404':
          description: Credential not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a new Data Destination
      tags:
        - DataDestinations
    get:
      operationId: DataDestinationController_getAll
      parameters:
        - name: ownerFilter
          required: false
          in: query
          description: Filter Data Destinations by whether they have owners
          schema:
            enum:
              - has_owners
              - no_owners
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DataDestinationResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get all Data Destinations
      tags:
        - DataDestinations
  /api/data-destinations/connect/google-sheets:
    post:
      operationId: DataDestinationController_createConnectGoogleSheets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConnectGoogleSheetsDestinationApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataDestinationResponseApiDto'
        '400':
          description: The Credential does not fit Google Sheets or is disabled
        '401':
          description: Authentication required
        '403':
          description: |-
            No USE on the Credential

            Forbidden. Required role: Business User
        '404':
          description: Credential not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: >-
        Create a Google Sheets destination bound to a Credential from the MCP
        connect flow (starts unshared internally)
      tags:
        - DataDestinations
  /api/data-destinations/excel:
    post:
      description: >-
        An Excel destination carries no credentials and no configuration, so
        there is nothing for a user to fill in: it is created on demand the
        first time a report is made from the Excel add-in. Resolved by access
        rather than by ownership: any Excel destination in the project the
        caller may use is returned, whoever created it, and a new one is created
        only when none is reachable. A created one is shared for use straight
        away, so the next caller is handed that one instead of getting another.
        Safe to call repeatedly.
      operationId: DataDestinationController_resolveExcel
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataDestinationResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get the project's Excel destination, creating it on first use
      tags:
        - DataDestinations
  /api/data-destinations/by-type/{type}:
    get:
      operationId: DataDestinationController_getByType
      parameters:
        - name: type
          required: true
          in: path
          description: Data Destination type
          schema:
            enum:
              - GOOGLE_SHEETS
              - LOOKER_STUDIO
              - EXCEL
              - EMAIL
              - SLACK
              - MS_TEAMS
              - GOOGLE_CHAT
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DataDestinationByTypeResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List Data Destinations by type
      tags:
        - DataDestinations
  /api/data-destinations/{id}:
    put:
      operationId: DataDestinationController_update
      parameters:
        - name: id
          required: true
          in: path
          description: Data Destination ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDataDestinationApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataDestinationResponseApiDto'
        '400':
          description: >-
            reusableCredentialId is null, missing where the type needs it, sent
            with credentials or for a type that takes no Credential, or names a
            Credential that does not fit the type or is disabled; or the request
            sends credentialId, sourceDestinationId, a Google Sheets key or a
            Google Chat webhook URL ("This page is out of date. Reload it.")
        '401':
          description: Authentication required
        '403':
          description: >-
            No EDIT on the Destination, no USE on the Credential ("You cannot
            use this Credential."), or a plugin-authenticated request that sends
            reusableCredentialId


            Forbidden. Required role: Business User
        '404':
          description: Destination or Credential not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update Data Destination by ID
      tags:
        - DataDestinations
    get:
      operationId: DataDestinationController_get
      parameters:
        - name: id
          required: true
          in: path
          description: Data Destination ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataDestinationResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get a Data Destination by ID
      tags:
        - DataDestinations
    delete:
      operationId: DataDestinationController_delete
      parameters:
        - name: id
          required: true
          in: path
          description: Data Destination ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Data Destination successfully deleted
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Delete Data Destination by ID
      tags:
        - DataDestinations
  /api/data-destinations/oauth/settings:
    get:
      operationId: DataDestinationController_getOAuthSettings
      responses:
        '200':
          description: OAuth configuration settings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleOAuthSettingsResponseDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get Google OAuth settings for Data Destinations
      tags:
        - DataDestinations
  /api/data-destinations/{id}/impact:
    get:
      operationId: DataDestinationController_getImpact
      parameters:
        - name: id
          required: true
          in: path
          description: Data Destination ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataDestinationImpactResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: >-
        Get usage impact for a Data Destination (reports + distinct data marts
        referencing it)
      tags:
        - DataDestinations
  /api/data-destinations/{id}/rotate-secret-key:
    post:
      operationId: DataDestinationController_rotateSecretKey
      parameters:
        - name: id
          required: true
          in: path
          description: Data Destination ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataDestinationResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Rotate secret key for Data Destination
      tags:
        - DataDestinations
  /api/data-destinations/{id}/availability:
    put:
      operationId: DataDestinationController_updateAvailability
      parameters:
        - name: id
          required: true
          in: path
          description: Data Destination ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDestinationAvailabilityApiDto'
      responses:
        '204':
          description: Data Destination availability updated
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update Data Destination availability
      tags:
        - DataDestinations
  /api/data-destinations/{id}/google-sheets/documents:
    post:
      operationId: DataDestinationController_createGoogleSheetDocument
      parameters:
        - name: id
          required: true
          in: path
          description: Data Destination ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGoogleSheetDocumentRequestDto'
      responses:
        '200':
          description: Identifiers of the newly created Google Sheet
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateGoogleSheetDocumentResponseDto'
        '400':
          description: >-
            Destination has no connected Google account, or is not a Google
            Sheets destination
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Auto-create a new Google Sheet for a Data Destination (Google Sheets)
      tags:
        - DataDestinations
  /api/reports/{id}:
    get:
      operationId: ReportController_get
      parameters:
        - name: id
          required: true
          in: path
          description: Report ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: The report
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get a report by ID
      tags:
        - Reports
    delete:
      description: >-
        Soft-deletes the report, retaining its configuration and run history.
        Deleted reports are excluded from report lists and cannot be read or
        run.
      operationId: ReportController_delete
      parameters:
        - name: id
          required: true
          in: path
          description: Report ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: The report has been successfully deleted.
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Delete a report
      tags:
        - Reports
    put:
      operationId: ReportController_update
      parameters:
        - name: id
          required: true
          in: path
          description: Report ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - title
                - dataDestinationId
                - destinationConfig
              properties:
                title:
                  type: string
                  example: My Report
                dataDestinationId:
                  type: string
                  description: ID of the data destination
                destinationConfig:
                  description: Configuration for the selected data destination.
                  oneOf:
                    - $ref: '#/components/schemas/ReportEmailDestinationConfigApiDto'
                    - allOf:
                        - $ref: '#/components/schemas/ReportLegacyEmailDestinationConfigApiDto'
                      not:
                        required:
                          - templateSource
                    - $ref: '#/components/schemas/ReportGoogleSheetsDestinationConfigApiDto'
                    - $ref: '#/components/schemas/ReportLookerStudioDestinationConfigApiDto'
                ownerIds:
                  type: array
                  items:
                    type: string
                  maxItems: 100
                columnConfig:
                  type: array
                  nullable: true
                  items:
                    type: string
                    minLength: 1
                    description: Selected output column name.
                  description: >-
                    Ordered selected output column names. Set null to include
                    all native columns.
                  example:
                    - date
                    - campaign_name
                    - spend
                filterConfig:
                  type: array
                  nullable: true
                  maxItems: 50
                  items:
                    $ref: '#/components/schemas/ReportFilterRuleApiDto'
                  description: >-
                    Output filters. Use placement=pre-join for slice filters
                    (column = unified blended identifier).
                sortConfig:
                  type: array
                  nullable: true
                  maxItems: 10
                  items:
                    $ref: '#/components/schemas/ReportSortRuleApiDto'
                  description: Ordered sort rules. Earlier rules take precedence.
                  example:
                    - column: date
                      direction: desc
                limitConfig:
                  type: integer
                  nullable: true
                  minimum: 1
                  maximum: 10000000
                  description: >-
                    Maximum number of rows to return. Set null to return without
                    an explicit cap.
                  example: 1000
                aggregationConfig:
                  type: array
                  nullable: true
                  maxItems: 50
                  items:
                    $ref: '#/components/schemas/ReportAggregationRuleApiDto'
                  description: >-
                    Aggregation rules. Each non-aggregated selected column
                    becomes a grouping key.
                dateTruncConfig:
                  type: array
                  nullable: true
                  maxItems: 50
                  items:
                    $ref: '#/components/schemas/ReportDateTruncRuleApiDto'
                  description: >-
                    Date-trunc rules. A date/timestamp dimension is bucketed by
                    a calendar unit.
                uniqueCountConfig:
                  oneOf:
                    - type: boolean
                    - type: array
                      items:
                        type: string
                      maxItems: 50
                  nullable: true
                  description: >-
                    Unique Count sources. `true` (legacy) counts distinct
                    primary keys of the main Data Mart; an array lists source
                    alias paths, where an empty string denotes the main Data
                    Mart.
                autoAggregationOptOut:
                  type: array
                  nullable: true
                  maxItems: 500
                  items:
                    type: string
                  description: >-
                    Columns whose aggregation the analyst removed. While any of
                    them is selected, the report is never collapsed
                    automatically and returns its rows as stored. Omit to keep
                    the stored value.
      responses:
        '200':
          description: The report has been successfully updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update an existing report
      tags:
        - Reports
  /api/reports/data-mart/{dataMartId}:
    get:
      operationId: ReportController_listByDataMart
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: Data mart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: List of reports for the data mart
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReportResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get all reports for a data mart
      tags:
        - Reports
  /api/reports/data-mart/{dataMartId}/insight-template/{insightTemplateId}:
    get:
      operationId: ReportController_listByInsightTemplate
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: Data mart ID
          schema:
            type: string
        - name: insightTemplateId
          required: true
          in: path
          description: Insight template ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: >-
            List of email reports that use the insight template as their
            template source
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReportResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get email reports that use an insight template
      tags:
        - Reports
  /api/reports/{id}/run:
    post:
      operationId: ReportController_runReport
      parameters:
        - name: id
          required: true
          in: path
          description: Report ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '201':
          description: The manual report run trigger has been successfully created.
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Trigger a manual report run
      tags:
        - Reports
  /api/reports/{id}/google-sheets/reconnect-sheet:
    post:
      description: >-
        Points the report at a sheet (tab) named after the report title,
        creating it when the spreadsheet has none, and repairs the stored sheet
        ID. Recovers a report whose sheet was deleted or re-created. No request
        body.
      operationId: ReportController_reconnectGoogleSheet
      parameters:
        - name: id
          required: true
          in: path
          description: Report ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: The report has been reconnected to the sheet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReconnectGoogleSheetResponseDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Reconnect a Google Sheets report to a sheet named after the report
      tags:
        - Reports
  /api/reports/{id}/output-schema:
    get:
      operationId: ReportController_getOutputSchema
      parameters:
        - name: id
          required: true
          in: path
          description: Report ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: >-
            The columns the report's rows will carry, in the order they are
            projected, as of the Data Mart's last schema actualization. `name`
            is the key each row is keyed by; `title` is the alias configured for
            it, absent when there is none. Columns the report synthesises —
            aggregated (`<column> | <FN>`), Unique Count, calculated fields —
            appear here and nowhere in the Data Mart schema. This reads the
            stored schema rather than the warehouse, so a column added
            warehouse-side and not yet actualized is missing here until a run or
            a data read picks it up.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReportOutputSchemaFieldApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get the resolved column schema of a report's output
      tags:
        - Reports
  /api/reports/{id}/generated-sql:
    get:
      operationId: ReportController_getGeneratedSql
      parameters:
        - name: id
          required: true
          in: path
          description: Report ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: The generated SQL query for the report.
          content:
            application/json:
              schema:
                type: object
                required:
                  - sql
                  - canModifySource
                properties:
                  sql:
                    type: string
                  canModifySource:
                    type: boolean
                    description: >-
                      Whether the caller has maintenance (edit) access to the
                      source data mart. False for read-only viewers, who can
                      read and copy the SQL but cannot dry-run it or copy it as
                      a new data mart.
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get the generated SQL for a report
      tags:
        - Reports
  /api/reports/{id}/copy-as-data-mart:
    post:
      operationId: ReportController_copyAsDataMart
      parameters:
        - name: id
          required: true
          in: path
          description: Report ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '201':
          description: The new data mart has been successfully created.
          content:
            application/json:
              schema:
                type: object
                required:
                  - dataMartId
                properties:
                  dataMartId:
                    type: string
                    format: uuid
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Copy a report as a new data mart with SQL definition
      tags:
        - Reports
  /api/data-marts/{dataMartId}/insights:
    post:
      operationId: InsightController_create
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInsightRequestApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a new Insight
      tags:
        - Insights
    get:
      operationId: InsightController_list
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InsightListItemResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List Insights for a DataMart
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insights/ai-generate:
    post:
      operationId: InsightController_createWithAi
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Create a new Insight with AI
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insights/{insightId}:
    get:
      operationId: InsightController_get
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightId
          required: true
          in: path
          description: Insight ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get an Insight by ID
      tags:
        - Insights
    put:
      operationId: InsightController_update
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightId
          required: true
          in: path
          description: Insight ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateInsightRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update Insight
      tags:
        - Insights
    delete:
      operationId: InsightController_delete
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightId
          required: true
          in: path
          description: Insight ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '204':
          description: Insight deleted
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Soft delete Insight
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insights/{insightId}/title:
    put:
      operationId: InsightController_updateTitle
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightId
          required: true
          in: path
          description: Insight ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateInsightTitleApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update Insight title
      tags:
        - Insights
  /api/data-marts/{dataMartId}/ai-assistant/sessions:
    post:
      operationId: AiAssistantController_createSession
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAiAssistantSessionRequestApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAiAssistantSessionResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create AI Source Assistant session
      tags:
        - Insights
    get:
      operationId: AiAssistantController_listSessions
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: scope
          required: true
          in: query
          schema:
            $ref: '#/components/schemas/AiAssistantScope'
        - name: templateId
          required: false
          in: query
          description: Template id filter. Use with template scope
          schema:
            example: 6f093b03-30c1-43e0-b9ed-6d87d33edf15
            type: string
        - name: limit
          required: false
          in: query
          description: Limit number of sessions
          schema:
            minimum: 1
            maximum: 100
            default: 20
            type: number
        - name: offset
          required: false
          in: query
          description: Offset for pagination
          schema:
            minimum: 0
            default: 0
            type: number
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AiAssistantSessionListItemResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List AI Source Assistant sessions for current user and context
      tags:
        - Insights
  /api/data-marts/{dataMartId}/ai-assistant/sessions/{sessionId}:
    get:
      operationId: AiAssistantController_getSession
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: sessionId
          required: true
          in: path
          description: AI Source Assistant Session ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiAssistantSessionResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get AI Source Assistant session with message history
      tags:
        - Insights
    delete:
      operationId: AiAssistantController_deleteSession
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: sessionId
          required: true
          in: path
          description: AI Source Assistant Session ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '204':
          description: ''
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Delete AI Source Assistant session
      tags:
        - Insights
  /api/data-marts/{dataMartId}/ai-assistant/sessions/{sessionId}/title:
    patch:
      operationId: AiAssistantController_updateSessionTitle
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: sessionId
          required: true
          in: path
          description: AI Source Assistant Session ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAiAssistantSessionTitleRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiAssistantSessionListItemResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update AI Source Assistant session title
      tags:
        - Insights
  /api/data-marts/{dataMartId}/ai-assistant/sessions/{sessionId}/messages:
    post:
      description: >-
        Returns lightweight response payload or heavy route trigger id depending
        on server-side routing.
      operationId: AiAssistantController_createMessage
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: sessionId
          required: true
          in: path
          description: AI Source Assistant Session ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAiAssistantMessageRequestApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAiAssistantMessageResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Append user message to AI Source Assistant session
      tags:
        - Insights
  /api/data-marts/{dataMartId}/ai-assistant/sessions/{sessionId}/apply:
    post:
      operationId: AiAssistantController_apply
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: sessionId
          required: true
          in: path
          description: AI Source Assistant Session ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplyAiAssistantSessionRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplyAiAssistantSessionResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Execute pre-created apply action by id
      tags:
        - Insights
  /api/data-marts/{dataMartId}/ai-assistant/run-triggers:
    get:
      operationId: AiAssistantRunTriggerController_listAiAssistantTriggers
      parameters:
        - name: dataMartId
          required: true
          in: path
          schema:
            type: string
        - name: sessionId
          required: true
          in: query
          description: AI assistant session id
          schema:
            example: 6f093b03-30c1-43e0-b9ed-6d87d33edf15
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Insights
  /api/data-marts/{dataMartId}/ai-assistant/run-triggers/{triggerId}/status:
    get:
      operationId: AiAssistantRunTriggerController_getTriggerStatus
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Insights
  /api/data-marts/{dataMartId}/ai-assistant/run-triggers/{triggerId}:
    get:
      operationId: AiAssistantRunTriggerController_getTriggerResponse
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Insights
    delete:
      operationId: AiAssistantRunTriggerController_abortTriggerRun
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-artifacts:
    post:
      operationId: InsightArtifactController_create
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInsightArtifactRequestApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightArtifactResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a new Insight Artifact
      tags:
        - Insights
    get:
      operationId: InsightArtifactController_list
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InsightArtifactListItemResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List Insight Artifacts for a DataMart
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-artifacts/{insightArtifactId}:
    get:
      operationId: InsightArtifactController_get
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightArtifactId
          required: true
          in: path
          description: Insight Artifact ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightArtifactResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get an Insight Artifact by ID
      tags:
        - Insights
    put:
      operationId: InsightArtifactController_update
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightArtifactId
          required: true
          in: path
          description: Insight Artifact ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateInsightArtifactRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightArtifactResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update Insight Artifact
      tags:
        - Insights
    delete:
      operationId: InsightArtifactController_delete
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightArtifactId
          required: true
          in: path
          description: Insight Artifact ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '204':
          description: Insight Artifact deleted
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Soft delete Insight Artifact
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-artifacts/{insightArtifactId}/title:
    put:
      operationId: InsightArtifactController_updateTitle
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightArtifactId
          required: true
          in: path
          description: Insight Artifact ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateInsightArtifactTitleApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightArtifactResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update Insight Artifact title
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-artifacts/{insightArtifactId}/sql-preview-triggers:
    post:
      description: >-
        Initiates asynchronous SQL preview for the specified Insight Artifact.
        Returns a trigger ID to check status and retrieve preview rows.
      operationId: InsightArtifactSqlPreviewTriggerController_createTrigger
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightArtifactId
          required: true
          in: path
          description: Insight Artifact ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunInsightArtifactSqlPreviewRequestApiDto'
      responses:
        '201':
          description: Trigger created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  triggerId:
                    type: string
                    description: ID of the created trigger
                    example: 550e8400-e29b-41d4-a716-446655440000
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a new Insight Artifact SQL preview trigger
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-artifacts/{insightArtifactId}/sql-preview-triggers/{triggerId}/status:
    get:
      operationId: InsightArtifactSqlPreviewTriggerController_getTriggerStatus
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-artifacts/{insightArtifactId}/sql-preview-triggers/{triggerId}:
    get:
      operationId: InsightArtifactSqlPreviewTriggerController_getTriggerResponse
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Insights
    delete:
      operationId: InsightArtifactSqlPreviewTriggerController_abortTriggerRun
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-templates:
    post:
      operationId: InsightTemplateController_create
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInsightTemplateRequestApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightTemplateResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a new Insight Template
      tags:
        - Insights
    get:
      operationId: InsightTemplateController_list
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InsightTemplateListItemResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List Insight Templates for a DataMart
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-templates/{insightTemplateId}:
    get:
      operationId: InsightTemplateController_get
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightTemplateId
          required: true
          in: path
          description: Insight Template ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightTemplateResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get an Insight Template by ID
      tags:
        - Insights
    put:
      operationId: InsightTemplateController_update
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightTemplateId
          required: true
          in: path
          description: Insight Template ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateInsightTemplateRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightTemplateResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update Insight Template
      tags:
        - Insights
    delete:
      operationId: InsightTemplateController_delete
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightTemplateId
          required: true
          in: path
          description: Insight Template ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '204':
          description: Insight Template deleted
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Soft delete Insight Template
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-templates/{insightTemplateId}/title:
    put:
      operationId: InsightTemplateController_updateTitle
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightTemplateId
          required: true
          in: path
          description: Insight Template ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateInsightTemplateTitleApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightTemplateResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update Insight Template title
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-templates/{insightTemplateId}/sources/{sourceId}:
    delete:
      operationId: InsightTemplateController_deleteSource
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightTemplateId
          required: true
          in: path
          description: Insight Template ID
          schema:
            type: string
        - name: sourceId
          required: true
          in: path
          description: Insight Template Source ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '204':
          description: Insight Template Source deleted
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Delete Insight Template Source and linked artifact
      tags:
        - Insights
    patch:
      operationId: InsightTemplateController_updateSource
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightTemplateId
          required: true
          in: path
          description: Insight Template ID
          schema:
            type: string
        - name: sourceId
          required: true
          in: path
          description: Insight Template Source ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateInsightTemplateSourceRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightTemplateSourceDetailsApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update Insight Template Source linked artifact
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-templates/{insightTemplateId}/sources:
    get:
      operationId: InsightTemplateController_listSources
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightTemplateId
          required: true
          in: path
          description: Insight Template ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InsightTemplateSourceDetailsApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List Insight Template Sources for a template
      tags:
        - Insights
    post:
      operationId: InsightTemplateController_createSource
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightTemplateId
          required: true
          in: path
          description: Insight Template ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInsightTemplateSourceRequestApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightTemplateSourceDetailsApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create Insight Template Source with linked artifact
      tags:
        - Insights
  /api/connectors:
    get:
      operationId: ConnectorController_getAvailableConnectors
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConnectorDefinitionResponseApiDto'
      summary: Get available connectors
      tags:
        - Connectors
  /api/connectors/{connectorName}/specification:
    get:
      operationId: ConnectorController_getConnectorSpecification
      parameters:
        - name: connectorName
          required: true
          in: path
          description: Connector name
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConnectorSpecificationResponseApiDto'
        '404':
          description: Connector not found
      summary: Get connector specification
      tags:
        - Connectors
  /api/connectors/{connectorName}/fields:
    get:
      operationId: ConnectorController_getConnectorFields
      parameters:
        - name: connectorName
          required: true
          in: path
          description: Connector name
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConnectorFieldsResponseApiDto'
        '404':
          description: Connector not found
      summary: Get connector fields
      tags:
        - Connectors
  /api/connectors/{connectorName}/fields/preview:
    post:
      operationId: ConnectorController_previewConnectorFields
      parameters:
        - name: connectorName
          required: true
          in: path
          description: Connector name
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectorFieldsPreviewRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConnectorFieldsResponseApiDto'
        '400':
          description: Unable to preview connector fields
        '401':
          description: Authentication required
        '403':
          description: |-
            Connector credentials cannot access the resource

            Forbidden. Required role: Data Owner
        '413':
          description: Request body too large
        '502':
          description: Connector provider is unavailable
        '504':
          description: Connector field preview timed out
      security:
        - X-OWOX-Authorization: []
      summary: Preview fields from a connector source configuration
      tags:
        - Connectors
  /api/connectors/{connectorName}/options/preview:
    post:
      description: >-
        Resolves the options of a field declared with the DYNAMIC_OPTIONS
        attribute from the source, for example the sheet tabs of the selected
        spreadsheet.
      operationId: ConnectorController_previewConnectorFieldOptions
      parameters:
        - name: connectorName
          required: true
          in: path
          description: Connector name
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectorFieldOptionsPreviewRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConnectorFieldOptionResponseApiDto'
        '400':
          description: Unable to preview connector field options
        '401':
          description: Authentication required
        '403':
          description: |-
            Connector credentials cannot access the resource

            Forbidden. Required role: Data Owner
        '413':
          description: Request body too large
        '502':
          description: Connector provider is unavailable
        '504':
          description: Connector field options preview timed out
      security:
        - X-OWOX-Authorization: []
      summary: Preview the allowed values of a connector configuration field
      tags:
        - Connectors
  /api/connectors/{connectorName}/oauth/settings:
    get:
      operationId: ConnectorController_getConnectorOAuthSettings
      parameters:
        - name: connectorName
          required: true
          in: path
          description: Connector name
          schema:
            type: string
        - name: path
          required: true
          in: query
          description: Path to the OAuth configuration in connector specification
          schema:
            example: AuthType.oauth2
            type: string
      responses:
        '200':
          description: OAuth UI settings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectorOAuthSettingsResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '404':
          description: Connector not found
      security:
        - X-OWOX-Authorization: []
      summary: Get OAuth settings (UI variables) for a connector
      tags:
        - Connectors
  /api/connectors/{connectorName}/oauth/exchange:
    post:
      description: >-
        Creates a Credential of the sign-in variant, or reconnects
        `credential.id`; returns no token.
      operationId: ConnectorController_handleOAuthCallback
      parameters:
        - name: connectorName
          required: true
          in: path
          description: Connector name
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExchangeOAuthCredentialsDto'
      responses:
        '201':
          description: The Credential was created or reconnected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectorOAuthCredentialsResponseApiDto'
        '400':
          description: Invalid OAuth credentials payload, or no `credential` target
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Connect a Source Credential through the connector's OAuth app
      tags:
        - Connectors
  /api/connectors/{connectorName}/oauth/status/{credentialId}:
    get:
      operationId: ConnectorController_getConnectorOAuthStatus
      parameters:
        - name: connectorName
          required: true
          in: path
          description: Connector name
          schema:
            type: string
        - name: credentialId
          required: true
          in: path
          description: OAuth credential ID
          schema:
            type: string
      responses:
        '200':
          description: OAuth credential status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectorOAuthStatusResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get connector OAuth status
      tags:
        - Connectors
  /api/connectors/custom:
    get:
      description: >-
        Returns every custom connector defined in the current project, with the
        version number currently active for each. Viewer access is required.
      operationId: ConnectorDefinitionController_list
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Custom connectors defined in the project.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomConnectorListItemResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List custom connectors
      tags:
        - Custom Connectors
    post:
      description: >-
        Registers a custom connector and stores the supplied manifest as its
        first draft version. Editor access is required.
      operationId: ConnectorDefinitionController_create
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomConnectorRequestApiDto'
      responses:
        '201':
          description: Custom connector created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCustomConnectorResponseApiDto'
        '400':
          description: >-
            Connector name is invalid, reserved by a built-in connector, or
            already taken
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a custom connector
      tags:
        - Custom Connectors
  /api/connectors/custom/test:
    post:
      description: >-
        Executes one node of an unsaved manifest and returns the records, the
        raw sample used for field discovery and the process logs. Editor access
        is required.
      operationId: ConnectorDefinitionController_test
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestConnectorRequestApiDto'
      responses:
        '201':
          description: >-
            Test run finished; `error` carries the failure when the run did not
            succeed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectorTestResultResponseApiDto'
        '400':
          description: >-
            Manifest is invalid, the node is unknown, the test concurrency limit
            is hit, or the Credential is disabled, does not fit the manifest or
            is joined by typed key parameters
        '401':
          description: Authentication required
        '403':
          description: |-
            The caller cannot use the Credential

            Forbidden. Required role: Data Owner
        '404':
          description: The Credential was not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Run a custom connector manifest against its source
      tags:
        - Custom Connectors
  /api/connectors/custom/fitting-credentials:
    post:
      description: >-
        Takes a manifest, or the name (and optional version) of a published
        custom connector, and returns the enabled custom connector Credentials
        the caller can use: id, title, hosts and field names, never values. A
        Credential that cannot be chosen for the manifest carries its refusal
        (unfit, misuse, or secret: it keeps a SECRET key as a public field); a
        fitting one has a null refusal. Editor access is required.
      operationId: ConnectorDefinitionController_fittingCredentials
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FittingCustomConnectorCredentialsRequestApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FittingCustomConnectorCredentialResponseApiDto'
        '400':
          description: >-
            Manifest is invalid, or not exactly one of manifest and
            connectorName is sent
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '404':
          description: The named custom connector was not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: >-
        List the usable Credentials for a custom connector manifest and whether
        each fits
      tags:
        - Custom Connectors
  /api/connectors/custom/credential-requirement:
    post:
      description: >-
        Takes the same body as fitting-credentials and returns the hosts a new
        Credential must allow and the key fields of the selection (labels,
        secret and required flags, never values; only required ones decide fit),
        plus every key parameter and the selection parameter. Editor access is
        required.
      operationId: ConnectorDefinitionController_credentialRequirement
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FittingCustomConnectorCredentialsRequestApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomConnectorCredentialRequirementResponseApiDto'
        '400':
          description: >-
            Manifest is invalid, or not exactly one of manifest and
            connectorName is sent
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '404':
          description: The named custom connector was not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Describe what a Credential needs to fit a custom connector manifest
      tags:
        - Custom Connectors
  /api/connectors/custom/{id}:
    get:
      description: >-
        Returns the connector together with every stored version. Viewer access
        is required.
      operationId: ConnectorDefinitionController_get
      parameters:
        - name: id
          required: true
          in: path
          description: Custom connector ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Custom connector with its version history.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomConnectorDetailResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '404':
          description: Custom connector not found
      security:
        - X-OWOX-Authorization: []
      summary: Get a custom connector with its version history
      tags:
        - Custom Connectors
    patch:
      description: >-
        Updates the title, description, logo or documentation URL. Omitted
        fields are left unchanged; an explicit null clears a nullable one. The
        connector name cannot be changed, because data marts reference their
        connector by name. Editor access is required.
      operationId: ConnectorDefinitionController_update
      parameters:
        - name: id
          required: true
          in: path
          description: Custom connector ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCustomConnectorRequestApiDto'
      responses:
        '200':
          description: The connector after the update.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomConnectorDetailResponseApiDto'
        '400':
          description: The body is invalid, e.g. an empty or null title
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '404':
          description: Custom connector not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update the display metadata of a custom connector
      tags:
        - Custom Connectors
    delete:
      description: >-
        Soft-deletes the connector and frees its name for reuse in the project.
        Refused while any Data Mart still references it. Editor access is
        required.
      operationId: ConnectorDefinitionController_remove
      parameters:
        - name: id
          required: true
          in: path
          description: Custom connector ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Custom connector deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteCustomConnectorResponseApiDto'
        '400':
          description: Custom connector is referenced by existing Data Marts
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '404':
          description: Custom connector not found
      security:
        - X-OWOX-Authorization: []
      summary: Delete a custom connector
      tags:
        - Custom Connectors
  /api/connectors/custom/{id}/versions/{version}:
    get:
      description: >-
        Returns the manifest stored for that version. Editor access is required:
        a manifest can hold a credential typed into the builder.
      operationId: ConnectorDefinitionController_getVersion
      parameters:
        - name: id
          required: true
          in: path
          description: Custom connector ID
          schema:
            type: string
        - name: version
          required: true
          in: path
          description: Version number
          schema:
            type: number
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Stored version and its manifest.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomConnectorVersionResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '404':
          description: Custom connector or version not found
      security:
        - X-OWOX-Authorization: []
      summary: Get one version of a custom connector
      tags:
        - Custom Connectors
  /api/connectors/custom/{id}/draft:
    put:
      description: >-
        Overwrites the open draft, or opens a new draft version when the latest
        version is already published. Editor access is required.
      operationId: ConnectorDefinitionController_saveDraft
      parameters:
        - name: id
          required: true
          in: path
          description: Custom connector ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SaveDraftRequestApiDto'
      responses:
        '200':
          description: Draft version the manifest was written to.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomConnectorVersionStateResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '404':
          description: Custom connector not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Save the draft manifest of a custom connector
      tags:
        - Custom Connectors
  /api/connectors/custom/{id}/publish:
    post:
      description: >-
        Marks the latest draft published and activates it in the same change.
        The response carries `warnings`: credential-handling problems the
        publish did not refuse the manifest for, and the only notice the author
        gets of them. Editor access is required, and an editor also needs edit
        access to every Data Mart that follows the active version: those run the
        published version next, with their credentials.
      operationId: ConnectorDefinitionController_publish
      parameters:
        - name: id
          required: true
          in: path
          description: Custom connector ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '201':
          description: Published version.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublishCustomConnectorResponseApiDto'
        '400':
          description: Connector has no draft to publish, or the draft manifest is invalid
        '401':
          description: Authentication required
        '403':
          description: |-
            An editor cannot edit a Data Mart that follows the active version

            Forbidden. Required role: Data Owner
        '404':
          description: Custom connector not found
      security:
        - X-OWOX-Authorization: []
      summary: Publish the draft version of a custom connector
      tags:
        - Custom Connectors
  /api/connectors/custom/{id}/versions/{version}/activate:
    post:
      description: >-
        Points the connector at an already published version, which is how a
        release is rolled back. Editor access is required, and an editor also
        needs edit access to every Data Mart that follows the active version:
        those run the activated version next, with their credentials.
      operationId: ConnectorDefinitionController_activate
      parameters:
        - name: id
          required: true
          in: path
          description: Custom connector ID
          schema:
            type: string
        - name: version
          required: true
          in: path
          description: Version number to activate
          schema:
            type: number
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '201':
          description: Version now active for this connector.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivateCustomConnectorVersionResponseApiDto'
        '400':
          description: No published version with that number
        '401':
          description: Authentication required
        '403':
          description: |-
            An editor cannot edit a Data Mart that follows the active version

            Forbidden. Required role: Data Owner
        '404':
          description: Custom connector not found
      security:
        - X-OWOX-Authorization: []
      summary: Activate a published version of a custom connector
      tags:
        - Custom Connectors
  /api/connectors/custom/{id}/specification:
    get:
      description: >-
        Renders the parameter specification from the requested manifest version,
        falling back to the active version. PUBLISHED versions only: a draft is
        an editor's work in progress, and the runner refuses one too. Values of
        parameters attributed SECRET (default, placeholder, options) are
        withheld. Viewer access is required.
      operationId: ConnectorDefinitionController_specification
      parameters:
        - name: id
          required: true
          in: path
          description: Custom connector ID
          schema:
            type: string
        - name: version
          required: false
          in: query
          description: Published version to render. Defaults to the active version.
          schema:
            type: number
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConnectorSpecificationResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '404':
          description: Custom connector not found, or the version is missing or unpublished
      security:
        - X-OWOX-Authorization: []
      summary: Get the configuration specification of a custom connector
      tags:
        - Custom Connectors
  /api/connectors/custom/{id}/fields:
    get:
      description: >-
        Renders the node/field schema from the requested manifest version,
        falling back to the active version. PUBLISHED versions only, matching
        the specification endpoint. Viewer access is required.
      operationId: ConnectorDefinitionController_fields
      parameters:
        - name: id
          required: true
          in: path
          description: Custom connector ID
          schema:
            type: string
        - name: version
          required: false
          in: query
          description: Published version to render. Defaults to the active version.
          schema:
            type: number
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ConnectorFieldsResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '404':
          description: Custom connector not found, or the version is missing or unpublished
      security:
        - X-OWOX-Authorization: []
      summary: Get the fields schema of a custom connector
      tags:
        - Custom Connectors
  /api/data-marts/{dataMartId}/scheduled-triggers:
    post:
      description: >-
        Creates a scheduled report, connector, or Data Quality run for a
        published DataMart. REPORT_RUN triggers require triggerConfig.reportId
        and report mutation access. CONNECTOR_RUN and DATA_QUALITY_RUN triggers
        must not include triggerConfig and require Data Mart trigger management
        access. DATA_QUALITY_RUN also requires an Output Schema, a definition,
        and at least one applicable enabled Data Quality check.
      operationId: ScheduledTriggerController_create
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        description: >-
          Set isActive to true to schedule the next run immediately. If omitted,
          isActive defaults to false.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateScheduledTriggerRequestApiDto'
            examples:
              reportRun:
                summary: Schedule a report run
                value:
                  type: REPORT_RUN
                  cronExpression: 0 9 * * *
                  timeZone: UTC
                  isActive: true
                  triggerConfig:
                    type: scheduled-report-run-config
                    reportId: 9cabc24e-1234-4a5a-8b12-abcdef123456
              connectorRun:
                summary: Schedule a connector run
                value:
                  type: CONNECTOR_RUN
                  cronExpression: 0 * * * *
                  timeZone: UTC
                  isActive: false
              dataQualityRun:
                summary: Schedule Data Quality checks
                value:
                  type: DATA_QUALITY_RUN
                  cronExpression: 0 6 * * *
                  timeZone: UTC
                  isActive: true
      responses:
        '201':
          description: Scheduled trigger created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledTriggerResponseApiDto'
        '400':
          description: >-
            Invalid request, invalid cron expression, invalid trigger config, or
            DataMart is not published
        '401':
          description: Authentication required
        '403':
          description: >-
            Insufficient permissions to manage the requested trigger type or
            report trigger target


            Forbidden. Required role: Business User
        '404':
          description: DataMart or report not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a scheduled trigger for a DataMart
      tags:
        - ScheduledTriggers
    get:
      description: >-
        Returns scheduled triggers for the DataMart in the current project,
        including createdByUser projections when available.
      operationId: ScheduledTriggerController_list
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ScheduledTriggerResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List scheduled triggers for a DataMart
      tags:
        - ScheduledTriggers
  /api/data-marts/{dataMartId}/scheduled-triggers/{id}:
    get:
      description: >-
        Returns a scheduled trigger that belongs to the specified DataMart and
        project.
      operationId: ScheduledTriggerController_get
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: id
          required: true
          in: path
          description: Scheduled Trigger ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledTriggerResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '404':
          description: Scheduled trigger not found
      security:
        - X-OWOX-Authorization: []
      summary: Get a scheduled trigger by ID
      tags:
        - ScheduledTriggers
    put:
      description: >-
        Updates cronExpression, timeZone, and isActive. Trigger type and
        triggerConfig are immutable. Permission checks are based on the existing
        trigger type.
      operationId: ScheduledTriggerController_update
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: id
          required: true
          in: path
          description: Scheduled Trigger ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateScheduledTriggerRequestApiDto'
      responses:
        '200':
          description: Scheduled trigger updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledTriggerResponseApiDto'
        '400':
          description: >-
            Invalid request, invalid cron expression, invalid stored trigger
            config, or DataMart is not published
        '401':
          description: Authentication required
        '403':
          description: >-
            Insufficient permissions to manage the requested trigger type or
            report trigger target


            Forbidden. Required role: Business User
        '404':
          description: Scheduled trigger not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update a scheduled trigger
      tags:
        - ScheduledTriggers
    delete:
      description: >-
        Deletes a scheduled trigger after applying permission checks based on
        the existing trigger type.
      operationId: ScheduledTriggerController_delete
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: id
          required: true
          in: path
          description: Scheduled Trigger ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Scheduled trigger deleted
        '400':
          description: Invalid stored trigger config
        '401':
          description: Authentication required
        '403':
          description: >-
            Insufficient permissions to manage the requested trigger type or
            report trigger target


            Forbidden. Required role: Business User
        '404':
          description: Scheduled trigger not found
      security:
        - X-OWOX-Authorization: []
      summary: Delete a scheduled trigger
      tags:
        - ScheduledTriggers
  /api/external/looker/get-config:
    post:
      operationId: LookerStudioConnectorController_getConfig
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - Looker Studio Connector endpoints
  /api/external/looker/get-schema:
    post:
      operationId: LookerStudioConnectorController_getSchema
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - Looker Studio Connector endpoints
  /api/external/looker/get-data:
    post:
      operationId: LookerStudioConnectorController_getData
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - Looker Studio Connector endpoints
  /api/data-marts/{dataMartId}/sql-dry-run-triggers:
    post:
      description: >-
        Creates an asynchronous SQL dry run trigger for the specified DataMart.
        Poll the trigger status, then retrieve the SQL dry run result when
        processing is finished.
      operationId: SqlDryRunTriggerController_createSqlDryRunTrigger
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SqlDryRunRequestApiDto'
      responses:
        '201':
          description: Trigger created successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - triggerId
                properties:
                  triggerId:
                    type: string
                    format: uuid
                    description: ID of the created trigger
                    example: 550e8400-e29b-41d4-a716-446655440000
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a new SQL dry run trigger
      tags:
        - DataMarts
  /api/data-marts/{dataMartId}/sql-dry-run-triggers/{triggerId}/status:
    get:
      description: Returns the current scheduler status for the SQL dry run trigger.
      operationId: SqlDryRunTriggerController_getTriggerStatus
      parameters:
        - name: triggerId
          required: true
          in: path
          description: SQL dry run trigger ID
          schema:
            type: string
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema: {}
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Current trigger status
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                properties:
                  status:
                    type: string
                    enum:
                      - IDLE
                      - READY
                      - PROCESSING
                      - SUCCESS
                      - ERROR
                      - CANCELLING
                      - CANCELLED
                    example: IDLE
                    description: Current trigger status
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '404':
          description: Trigger not found
      security:
        - X-OWOX-Authorization: []
      summary: Get SQL dry run trigger status
      tags:
        - DataMarts
  /api/data-marts/{dataMartId}/sql-dry-run-triggers/{triggerId}:
    get:
      description: >-
        Returns and removes the SQL dry run result when the trigger succeeds.
        SQL validation failures are returned as isValid=false with an error
        message.
      operationId: SqlDryRunTriggerController_getTriggerResponse
      parameters:
        - name: triggerId
          required: true
          in: path
          description: SQL dry run trigger ID
          schema:
            type: string
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema: {}
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: SQL dry run result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SqlDryRunResponseApiDto'
        '400':
          description: Trigger failed or was cancelled
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '404':
          description: Trigger not found
        '408':
          description: Trigger response is not ready
      security:
        - X-OWOX-Authorization: []
      summary: Get SQL dry run result
      tags:
        - DataMarts
    delete:
      description: >-
        Cancels a SQL dry run trigger owned by the current user. Idle or
        successful triggers are removed; ready or processing triggers are marked
        as cancelling.
      operationId: SqlDryRunTriggerController_abortTriggerRun
      parameters:
        - name: triggerId
          required: true
          in: path
          description: SQL dry run trigger ID
          schema:
            type: string
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema: {}
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Trigger cancellation accepted or trigger removed
        '400':
          description: Trigger can't be cancelled at current state
        '401':
          description: Authentication required
        '403':
          description: |-
            Forbidden. Required role: Business User

            Current user is not allowed to cancel this trigger
        '404':
          description: Trigger not found
      security:
        - X-OWOX-Authorization: []
      summary: Cancel SQL dry run trigger
      tags:
        - DataMarts
  /api/data-marts/{dataMartId}/schema-actualize-triggers:
    post:
      operationId: SchemaActualizeTriggerController_createTrigger
      parameters:
        - name: dataMartId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - DataMarts
  /api/data-marts/{dataMartId}/schema-actualize-triggers/{triggerId}/status:
    get:
      operationId: SchemaActualizeTriggerController_getTriggerStatus
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - DataMarts
  /api/data-marts/{dataMartId}/schema-actualize-triggers/{triggerId}:
    get:
      operationId: SchemaActualizeTriggerController_getTriggerResponse
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - DataMarts
    delete:
      operationId: SchemaActualizeTriggerController_abortTriggerRun
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - DataMarts
  /api/data-marts/{id}/preview:
    post:
      operationId: DataMartPreviewController_preview
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PreviewDataMartRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PreviewDataMartResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Read a sample of Data Mart rows for the Data Setup preview
      tags:
        - DataMarts
  /api/data-storages/{dataStorageId}/publish-drafts-triggers:
    post:
      operationId: PublishDraftsTriggerController_createTrigger
      parameters:
        - name: dataStorageId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      tags:
        - DataStorages
  /api/data-storages/{dataStorageId}/publish-drafts-triggers/{triggerId}/status:
    get:
      operationId: PublishDraftsTriggerController_getTriggerStatus
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - DataStorages
  /api/data-storages/{dataStorageId}/publish-drafts-triggers/{triggerId}:
    get:
      operationId: PublishDraftsTriggerController_getTriggerResponse
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - DataStorages
    delete:
      operationId: PublishDraftsTriggerController_abortTriggerRun
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - DataStorages
  /api/data-marts/{dataMartId}/ai-helper/triggers:
    post:
      description: >-
        Creates an asynchronous AI metadata generation trigger for the specified
        DataMart. Poll the trigger status, then retrieve the result when
        processing is finished.
      operationId: AiHelperTriggerController_createAiHelperTrigger
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAiHelperTriggerRequestApiDto'
      responses:
        '201':
          description: Trigger created successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - triggerId
                properties:
                  triggerId:
                    type: string
                    format: uuid
                    description: ID of the created trigger
                    example: 550e8400-e29b-41d4-a716-446655440000
        '401':
          description: Authentication required
        '403':
          description: |-
            Forbidden. Required role: Data Owner

            Current user is not allowed to edit this DataMart
        '413':
          description: Request body too large
        '503':
          description: AI helper is not configured on this deployment
      security:
        - X-OWOX-Authorization: []
      summary: Create a new AI helper trigger
      tags:
        - DataMarts
  /api/data-marts/{dataMartId}/ai-helper/triggers/{triggerId}/status:
    get:
      description: Returns the current scheduler status for the AI helper trigger.
      operationId: AiHelperTriggerController_getTriggerStatus
      parameters:
        - name: triggerId
          required: true
          in: path
          description: AI helper trigger ID
          schema:
            type: string
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema: {}
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Current trigger status
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                properties:
                  status:
                    type: string
                    enum:
                      - IDLE
                      - READY
                      - PROCESSING
                      - SUCCESS
                      - ERROR
                      - CANCELLING
                      - CANCELLED
                    example: IDLE
                    description: Current trigger status
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '404':
          description: Trigger not found
      security:
        - X-OWOX-Authorization: []
      summary: Get AI helper trigger status
      tags:
        - DataMarts
  /api/data-marts/{dataMartId}/ai-helper/triggers/{triggerId}:
    get:
      description: >-
        Returns and removes the AI helper result when the trigger succeeds.
        Trigger errors are returned with HTTP 400 carrying the user-facing error
        message.
      operationId: AiHelperTriggerController_getTriggerResponse
      parameters:
        - name: triggerId
          required: true
          in: path
          description: AI helper trigger ID
          schema:
            type: string
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema: {}
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: AI helper result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiHelperTriggerResponseApiDto'
        '400':
          description: Trigger failed or was cancelled
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '404':
          description: Trigger not found
        '408':
          description: Trigger response is not ready
      security:
        - X-OWOX-Authorization: []
      summary: Get AI helper result
      tags:
        - DataMarts
    delete:
      description: >-
        Cancels an AI helper trigger owned by the current user. Idle or
        successful triggers are removed; ready or processing triggers are marked
        as cancelling.
      operationId: AiHelperTriggerController_abortTriggerRun
      parameters:
        - name: triggerId
          required: true
          in: path
          description: AI helper trigger ID
          schema:
            type: string
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema: {}
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Trigger cancellation accepted or trigger removed
        '400':
          description: Trigger can't be cancelled at current state
        '401':
          description: Authentication required
        '403':
          description: |-
            Forbidden. Required role: Business User

            Current user is not allowed to cancel this trigger
        '404':
          description: Trigger not found
      security:
        - X-OWOX-Authorization: []
      summary: Cancel AI helper trigger
      tags:
        - DataMarts
  /api/data-marts/{dataMartId}/insights/{insightId}/run-triggers:
    post:
      description: >-
        Initiates an asynchronous run of the specified Insight. Returns a
        trigger ID to check status and retrieve the runId.
      operationId: InsightRunTriggerController_createTrigger
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightId
          required: true
          in: path
          description: Insight ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '201':
          description: Trigger created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  triggerId:
                    type: string
                    description: ID of the created trigger
                    example: 550e8400-e29b-41d4-a716-446655440000
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Create a new Insight run trigger
      tags:
        - Insights
    get:
      description: Returns a list of triggers for the specified Insight.
      operationId: InsightRunTriggerController_listInsightTriggers
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightId
          required: true
          in: path
          description: Insight ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InsightRunTriggerListItemResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List Insight run triggers
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insights/{insightId}/run-triggers/{triggerId}/status:
    get:
      operationId: InsightRunTriggerController_getTriggerStatus
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insights/{insightId}/run-triggers/{triggerId}:
    get:
      operationId: InsightRunTriggerController_getTriggerResponse
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Insights
    delete:
      operationId: InsightRunTriggerController_abortTriggerRun
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-templates/{insightTemplateId}/run-triggers:
    post:
      description: >-
        Initiates an asynchronous run of the specified Insight Template. Returns
        a trigger ID to check status and retrieve the runId.
      operationId: InsightTemplateRunTriggerController_createTrigger
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightTemplateId
          required: true
          in: path
          description: Insight Template ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInsightTemplateRunTriggerRequestApiDto'
      responses:
        '201':
          description: Trigger created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  triggerId:
                    type: string
                    description: ID of the created trigger
                    example: 550e8400-e29b-41d4-a716-446655440000
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a new Insight Template run trigger
      tags:
        - Insights
    get:
      description: Returns a list of triggers for the specified Insight Template.
      operationId: InsightTemplateRunTriggerController_listInsightTemplateTriggers
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: DataMart ID
          schema:
            type: string
        - name: insightTemplateId
          required: true
          in: path
          description: Insight Template ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/InsightTemplateRunTriggerListItemResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List Insight Template run triggers
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-templates/{insightTemplateId}/run-triggers/{triggerId}/status:
    get:
      operationId: InsightTemplateRunTriggerController_getTriggerStatus
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Insights
  /api/data-marts/{dataMartId}/insight-templates/{insightTemplateId}/run-triggers/{triggerId}:
    get:
      operationId: InsightTemplateRunTriggerController_getTriggerResponse
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Insights
    delete:
      operationId: InsightTemplateRunTriggerController_abortTriggerRun
      parameters:
        - name: triggerId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Insights
  /api/markdown/parse-to-html:
    post:
      operationId: MarkdownParserController_parseToHtml
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarkdownParseRequestApiDto'
      responses:
        '201':
          description: >-
            Rendered HTML using the same Markdown pipeline as the OWOX Data
            Marts UI
          content:
            text/html:
              schema:
                type: string
                example: <div class="markdown-body"><h1>Revenue</h1></div>
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Convert Markdown to application-rendered HTML
      tags:
        - Utils
  /api/internal/legacy-data-marts-sync/{id}:
    post:
      operationId: LegacyDataMartsSyncController_syncDataMart
      parameters:
        - name: id
          required: true
          in: path
          description: Data mart ID
          schema:
            type: string
      responses:
        '204':
          description: Data sync initiated
      summary: Sync legacy data mart by ID
      tags:
        - LegacyDataMartsSync
    delete:
      operationId: LegacyDataMartsSyncController_deleteDataMart
      parameters:
        - name: id
          required: true
          in: path
          description: Data mart ID
          schema:
            type: string
      responses:
        '204':
          description: Data mart deletion initiated
      summary: Delete legacy data mart by ID
      tags:
        - LegacyDataMartsSync
  /api/project-setup-progress:
    get:
      operationId: ProjectSetupProgressController_getProgress
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: The merged setup progress for the current project member.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectSetupProgressResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get project setup progress
      tags:
        - project-setup-progress
  /api/data-marts/{dataMartId}/relationships:
    post:
      operationId: DataMartRelationshipController_create
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: Source data mart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRelationshipRequestApiDto'
      responses:
        '201':
          description: The relationship has been successfully created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelationshipResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a new relationship for a data mart
      tags:
        - Data Mart Relationships
  /api/data-marts/{dataMartId}/relationships/graph:
    get:
      operationId: DataMartRelationshipController_getGraph
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: Root data mart ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: >-
            Flat list of relationship nodes with aliasPath, depth, cycle and
            blocked flags
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelationshipGraphResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: >-
        Get the full relationship graph rooted at this data mart (single SEE
        check on root)
      tags:
        - Data Mart Relationships
  /api/data-marts/{dataMartId}/relationships/{id}:
    patch:
      operationId: DataMartRelationshipController_update
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: Source data mart ID
          schema:
            type: string
        - name: id
          required: true
          in: path
          description: Relationship ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRelationshipRequestApiDto'
      responses:
        '200':
          description: The relationship has been successfully updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelationshipResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update an existing relationship
      tags:
        - Data Mart Relationships
    delete:
      operationId: DataMartRelationshipController_delete
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: Source data mart ID
          schema:
            type: string
        - name: id
          required: true
          in: path
          description: Relationship ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '204':
          description: The relationship has been successfully deleted.
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
      security:
        - X-OWOX-Authorization: []
      summary: Delete a relationship
      tags:
        - Data Mart Relationships
  /api/model-canvas/data-marts:
    get:
      operationId: ModelCanvasController_getDataMarts
      parameters:
        - name: storageId
          required: true
          in: query
          description: Data storage ID scoping the canvas
          schema:
            type: string
        - name: offset
          required: false
          in: query
          description: Number of data marts to skip before returning results
          schema:
            minimum: 0
            default: 0
            type: number
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Data marts are access-filtered like the data mart list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelCanvasDataMartsResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get a page of data marts of a storage for the project data model canvas
      tags:
        - Model Canvas
  /api/model-canvas/edges:
    get:
      operationId: ModelCanvasController_getEdges
      parameters:
        - name: storageId
          required: true
          in: query
          description: Data storage ID scoping the canvas
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Edges reference only data marts visible to the current user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelCanvasEdgesResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: >-
        Get the relationships between visible data marts of a storage for the
        model canvas
      tags:
        - Model Canvas
  /api/data-storages/{storageId}/relationships:
    get:
      operationId: DataStorageRelationshipController_listByStorage
      parameters:
        - name: storageId
          required: true
          in: path
          description: Data storage ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: List of relationships for the data storage
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RelationshipResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List all relationships for a data storage
      tags:
        - Data Storage Relationships
  /api/contexts:
    post:
      operationId: ContextController_create
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateContextRequestApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '409':
          description: Context name already exists in this project
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a new Context
      tags:
        - Contexts
    get:
      operationId: ContextController_list
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ContextResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List all Contexts in the project
      tags:
        - Contexts
  /api/contexts/{id}:
    put:
      operationId: ContextController_update
      parameters:
        - name: id
          required: true
          in: path
          description: Context ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContextRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '404':
          description: Context not found
        '409':
          description: Context name already exists in this project
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update a Context by ID
      tags:
        - Contexts
    delete:
      description: >-
        Soft-deletes the context. Returns 409 with impact counts if it is still
        attached to any Data Mart, Storage, Destination, User Provisioning
        default or non-admin member with Selected contexts scope — caller must
        detach first. Assignments kept by admins or Entire project members, and
        links of deleted Data Marts, Storages and Destinations, do not block and
        are removed with the context.
      operationId: ContextController_delete
      parameters:
        - name: id
          required: true
          in: path
          description: Context ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '204':
          description: Context deleted
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '404':
          description: Context not found
        '409':
          description: Context is still attached to resources or members
      security:
        - X-OWOX-Authorization: []
      summary: Delete a Context by ID
      tags:
        - Contexts
  /api/contexts/{id}/icon:
    put:
      operationId: ContextController_updateIcon
      parameters:
        - name: id
          required: true
          in: path
          description: Context ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContextIconApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '404':
          description: Context not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update a Context icon by ID
      tags:
        - Contexts
  /api/contexts/{id}/impact:
    get:
      description: >-
        Used to render the "Cannot delete" dialog. Returns counts of resources
        and members that reference the context.
      operationId: ContextController_getImpact
      parameters:
        - name: id
          required: true
          in: path
          description: Context ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContextImpactResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '404':
          description: Context not found
      security:
        - X-OWOX-Authorization: []
      summary: Get usage counts and affected members for a Context
      tags:
        - Contexts
  /api/contexts/{id}/members:
    put:
      description: >-
        Admins are silently dropped from the input — they always have
        project-wide scope. The dropped admin user ids are returned in
        `droppedAdminIds` so the UI can warn the caller.
      operationId: ContextController_setContextMembers
      parameters:
        - name: id
          required: true
          in: path
          description: Context ID
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContextMembersRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateContextMembersResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '404':
          description: Context not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Replace the set of non-admin members bound to a Context
      tags:
        - Contexts
  /api/members:
    get:
      operationId: ProjectMembersController_list
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProjectMemberResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List project members with their role scope and assigned contexts
      tags:
        - Project Members
  /api/members/invite:
    post:
      description: >-
        Returns a discriminated union by `kind`: `email-sent` when the IDP
        server delivers the invitation email itself, or `magic-link` when the
        IDP returns a one-time link the admin must share manually.
      operationId: ProjectMembersController_invite
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InviteMemberRequestApiDto'
      responses:
        '202':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InviteMemberResponseApiDto'
        '400':
          description: Invalid email, role, or context ids
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '409':
          description: Member with this email already exists
        '413':
          description: Request body too large
        '502':
          description: Upstream IDP failure
      security:
        - X-OWOX-Authorization: []
      summary: Invite a new project member by email
      tags:
        - Project Members
  /api/members/user-provisioning-settings:
    get:
      description: >-
        Returns `isApplicable=false` when the active IDP/project does not
        support organization-backed user provisioning. `isMainProject` tells the
        UI whether settings are editable for this project.
      operationId: ProjectMembersController_getProvisioningSettings
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserProvisioningSettingsResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '502':
          description: Upstream IDP failure
      security:
        - X-OWOX-Authorization: []
      summary: Get user provisioning settings for the current project
      tags:
        - Project Members
    put:
      description: >-
        Only the organization main project can update provisioning settings.
        IDP/analytics owns provisioning mode and default role; ODM stores
        context-scope defaults locally.
      operationId: ProjectMembersController_updateProvisioningSettings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateUserProvisioningSettingsRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserProvisioningSettingsResponseApiDto'
        '400':
          description: Invalid context ids or selected_contexts without contexts
        '401':
          description: Authentication required
        '403':
          description: |-
            Current project is not the organization main project

            Forbidden. Required role: Project Admin
        '413':
          description: Request body too large
        '502':
          description: Upstream IDP failure
      security:
        - X-OWOX-Authorization: []
      summary: Update user provisioning defaults for the current project
      tags:
        - Project Members
  /api/members/{userId}:
    put:
      description: >-
        When the role changes, the IDP is updated first; only on success local
        scope and context bindings are persisted.
      operationId: ProjectMembersController_update
      parameters:
        - name: userId
          required: true
          in: path
          description: Project member user ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMemberRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateMemberResponseApiDto'
        '400':
          description: Invalid context ids
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '404':
          description: Member not found in project
        '413':
          description: Request body too large
        '502':
          description: Upstream IDP failure when changing role
      security:
        - X-OWOX-Authorization: []
      summary: Update a project member's role, scope, and context bindings
      tags:
        - Project Members
    delete:
      description: >-
        Removes the member from the IDP and clears their local scope and context
        bindings. Idempotent for users already absent from the IDP.
      operationId: ProjectMembersController_remove
      parameters:
        - name: userId
          required: true
          in: path
          description: Project member user ID
          schema:
            type: string
      responses:
        '204':
          description: Member removed
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '502':
          description: Upstream IDP failure
      security:
        - X-OWOX-Authorization: []
      summary: Remove a project member
      tags:
        - Project Members
  /api/members/requests:
    get:
      description: >-
        Returns the array of pending requests for the project. Empty array means
        there are no pending requests. The non-OWOX IDP providers (better-auth,
        null) return an empty list rather than throwing.
      operationId: ProjectMembersController_listRequests
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MembershipRequestApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '502':
          description: Upstream IDP failure
      security:
        - X-OWOX-Authorization: []
      summary: List pending project membership requests
      tags:
        - Project Members
  /api/members/requests/{requestId}/approve:
    post:
      description: >-
        Resolves the requester into a full project member with the chosen role.
        Optionally narrows the role scope and pre-assigns contexts. Mirrors the
        post-invite scope/context apply.
      operationId: ProjectMembersController_approveRequest
      parameters:
        - name: requestId
          required: true
          in: path
          description: Pending request id (stable identifier from IDP)
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApproveMembershipRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApproveMembershipRequestResponseApiDto'
        '400':
          description: Invalid role or context ids
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '404':
          description: Membership request not found
        '413':
          description: Request body too large
        '501':
          description: IDP provider does not support membership requests
        '502':
          description: Upstream IDP failure
      security:
        - X-OWOX-Authorization: []
      summary: Approve a pending membership request
      tags:
        - Project Members
  /api/members/requests/{requestId}/decline:
    post:
      description: >-
        Removes the request from the pending queue. Returns 404 if the request
        was already removed or never existed (symmetric with approve).
      operationId: ProjectMembersController_declineRequest
      parameters:
        - name: requestId
          required: true
          in: path
          description: Pending request id (stable identifier from IDP)
          schema:
            type: string
      responses:
        '204':
          description: Request declined
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '404':
          description: Membership request not found
        '501':
          description: IDP provider does not support membership requests
        '502':
          description: Upstream IDP failure
      security:
        - X-OWOX-Authorization: []
      summary: Decline a pending membership request
      tags:
        - Project Members
  /api/project-member-api-keys:
    get:
      operationId: ProjectMemberApiKeysController_list
      parameters:
        - name: includeRevoked
          required: false
          in: query
          description: Include revoked keys in the response
          schema:
            type: boolean
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProjectMemberApiKeyResponseDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List API keys for the current project member
      tags:
        - Project Member API Keys
    post:
      operationId: ProjectMemberApiKeysController_create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProjectMemberApiKeyRequestDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateProjectMemberApiKeyResponseDto'
        '400':
          description: Invalid request body
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Create a new API key for the current project member
      tags:
        - Project Member API Keys
  /api/project-member-api-keys/{apiKeyId}:
    patch:
      operationId: ProjectMemberApiKeysController_update
      parameters:
        - name: apiKeyId
          required: true
          in: path
          description: API key identifier
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProjectMemberApiKeyRequestDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectMemberApiKeyResponseDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '404':
          description: API key not found
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update an existing API key name
      tags:
        - Project Member API Keys
    delete:
      description: >-
        Permanently revokes the API key. Any integrations using this key will
        stop working immediately.
      operationId: ProjectMemberApiKeysController_revoke
      parameters:
        - name: apiKeyId
          required: true
          in: path
          description: API key identifier
          schema:
            type: string
      responses:
        '204':
          description: API key revoked
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '404':
          description: API key not found
      security:
        - X-OWOX-Authorization: []
      summary: Revoke an API key
      tags:
        - Project Member API Keys
  /api/external/http-data/data-marts/{dataMartId}.ndjson:
    get:
      description: >-
        Streams rows of a published Data Mart as newline-delimited JSON (one
        data row per line, no envelope). Output selectors use `columns=*` or
        `columns=**`; exact column names use repeated `column` parameters. Row
        objects use resolved column names as keys in the requested order. Omit
        both `columns` and `column` (without `uniqueCount`), or pass
        `columns=*`, for all native columns. Pass `columns=**` for all native
        plus all reporting-visible blended columns. When `aggregation` or
        `dateTrunc` is used the row keys are the RESOLVED output labels — an
        aggregated column becomes `"<column> | <TOKEN>"`, where `<TOKEN>` is an
        uppercase spreadsheet-style token for the function (most match the
        function name, but `COUNT_DISTINCT` becomes `COUNTUNIQUE`, `P50` becomes
        `MEDIAN`, `STRING_AGG` becomes `STRINGAGG`, `ANY_VALUE` becomes
        `ANYVALUE`) — and an explicit `column` projection is required (a
        wildcard selector would group by every column). With `uniqueCount` each
        requested source adds a `COUNT(DISTINCT <primary key>)` column, keyed
        `Unique Count` for the Data Mart itself and `<alias path>__unique_count`
        for a joined source (dots in the path become `_`). Authenticated with
        the ODM member token via `x-owox-authorization`. Successful executions
        and execution failures are recorded as DataMartRuns of type HTTP_DATA,
        available through the run history endpoint. Requests rejected because of
        invalid query configuration are not recorded.
      operationId: HttpDataController_stream
      parameters:
        - name: dataMartId
          required: true
          in: path
          description: >-
            Data Mart identifier (UUID for native Data Marts, free-form string
            for legacy ones)
          schema:
            type: string
        - name: columns
          required: false
          in: query
          description: >-
            Optional column-set selector. `*` selects all current Data Mart
            output columns; `**` selects all columns available to Reports,
            including joined fields. `columns=*` may be combined with repeated
            `column` values. `columns=**` cannot be combined with `column` or
            another `columns` value. Omit `columns` and `column` to select all
            current Data Mart output columns, unless `uniqueCount` is given:
            then the read returns a single total row.
          schema:
            enum:
              - '*'
              - '**'
            type: string
        - name: column
          required: false
          in: query
          description: >-
            Exact column name to include in the output. Repeat the parameter to
            select multiple exact column names; the order of repetition is
            preserved in row objects. Values are opaque strings. `column=*` and
            `column=**` refer to literal columns named `*` and `**`; use
            `columns=*` or `columns=**` for selectors. Overlaps are
            de-duplicated.
          schema:
            type: array
            items:
              type: string
              minLength: 1
        - name: filter
          required: false
          in: query
          description: >-
            Optional base64url-encoded JSON matching the `FilterConfig` schema
            (same shape as Reports), applied server-side before streaming.
            Encode the JSON array with base64url (URL-safe base64: `-`/`_`
            instead of `+`/`/`, no `=` padding) so it survives the query string.
            Example JSON:
            `[{"column":"date","operator":"gte","value":"2026-01-01"}]` →
            base64url
            `W3siY29sdW1uIjoiZGF0ZSIsIm9wZXJhdG9yIjoiZ3RlIiwidmFsdWUiOiIyMDI2LTAxLTAxIn1d`.
            `in`/`not_in` rules take an array of 1..500 same-type values (never
            a comma-separated string):
            `[{"column":"country","operator":"in","value":["Germany","Ukraine"]}]`.
            The whole encoded parameter is capped at 8192 characters (~6 KB of
            JSON), so with long values that length cap can bind before the
            value-count cap does.
          schema:
            type: string
            minLength: 1
            maxLength: 8192
        - name: sort
          required: false
          in: query
          description: >-
            Optional base64url-encoded JSON matching the `SortConfig` schema,
            applied server-side. Encode the JSON array with base64url (URL-safe
            base64: `-`/`_` instead of `+`/`/`, no `=` padding). Example JSON:
            `[{"column":"date","direction":"desc"}]` → base64url
            `W3siY29sdW1uIjoiZGF0ZSIsImRpcmVjdGlvbiI6ImRlc2MifV0`.
          schema:
            type: string
            minLength: 1
            maxLength: 8192
        - name: aggregation
          required: false
          in: query
          description: >-
            Optional base64url-encoded JSON matching the `AggregationConfig`
            schema (same rule shape as Reports: an array of `{ column, function
            }`). Any selected column without an aggregation rule becomes a
            grouping key. Encode the JSON array with base64url (URL-safe base64:
            `-`/`_` instead of `+`/`/`, no `=` padding). Example JSON:
            `[{"column":"revenue","function":"SUM"}]` → base64url
            `W3siY29sdW1uIjoicmV2ZW51ZSIsImZ1bmN0aW9uIjoiU1VNIn1d`.
          schema:
            type: string
            minLength: 1
            maxLength: 8192
        - name: dateTrunc
          required: false
          in: query
          description: >-
            Optional base64url-encoded JSON matching the `DateTruncConfig`
            schema (same rule shape as Reports: an array of `{ column, unit,
            timeZone? }`), bucketing a date/timestamp dimension by a calendar
            unit (DAY/WEEK/MONTH/QUARTER/YEAR). Encode the JSON array with
            base64url (URL-safe base64: `-`/`_` instead of `+`/`/`, no `=`
            padding). Example JSON: `[{"column":"date","unit":"MONTH"}]` →
            base64url `W3siY29sdW1uIjoiZGF0ZSIsInVuaXQiOiJNT05USCJ9XQ`.
          schema:
            type: string
            minLength: 1
            maxLength: 8192
        - name: uniqueCount
          required: false
          in: query
          description: >-
            Optional base64url-encoded non-empty JSON array of Unique Count
            sources: source alias paths, where an empty string is the Data Mart
            itself. Each source counts distinct values of its primary key,
            whatever the key type, and the array holds 1 to 50 sources. The
            output key is `Unique Count` for the Data Mart itself and `<alias
            path>__unique_count` for a joined source (dots in the path become
            `_`); a `sort` rule may name that key, as in Reports. Omit `columns`
            and `column` for a single total row, or pass explicit `column`
            values to count per group; `columns=*` and `columns=**` are
            rejected, and so is a `pre-join` filter on a single-total-row read.
            A source without a primary key, or a joined Data Mart that is not
            joined, excluded from reporting or not accessible to the caller, is
            rejected. A Unique Count key cannot be listed in `column` or used in
            a `filter`, `aggregation` or `dateTrunc` rule. Example JSON: `[""]`
            → base64url `WyIiXQ`.
          schema:
            type: string
            minLength: 1
            maxLength: 8192
        - name: limit
          required: false
          in: query
          description: Optional row cap (positive integer).
          schema:
            type: integer
            minimum: 1
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: >-
            NDJSON stream of row objects. Each line is a complete JSON object
            whose keys match the requested columns, in the requested order. The
            response includes the `x-owox-run-id` header with the created
            DataMartRun ID.
          headers:
            x-owox-run-id:
              description: ID of the created DataMartRun (HTTP_DATA) for traceability
              schema:
                type: string
          content:
            application/x-ndjson:
              schema:
                type: string
                example: |
                  {"date":"2026-05-01","revenue":42.5}
                  {"date":"2026-05-02","revenue":51.0}
        '400':
          description: >-
            Invalid request: unknown column (including in an aggregation or
            dateTrunc rule), forbidden pagination parameter
            (`pageToken`/`offset`), malformed
            filter/sort/aggregation/dateTrunc/uniqueCount/limit, aggregation or
            dateTrunc without an explicit `column` projection, an empty
            uniqueCount, uniqueCount with `columns=*`/`columns=**`, a Unique
            Count source without a primary key or not available for reporting, a
            Unique Count key in `column`/filter/aggregation/dateTrunc,
            unsupported storage type, or a project blocked because it is
            inactive or has exceeded its credit limit. Invalid query parameters
            create no run. Errors in saved Data Mart configuration create a
            FAILED run. Project blocks create RESTRICTED runs. No 400 response
            carries an `x-owox-run-id` header.
        '401':
          description: Authentication required
        '403':
          description: >-
            Forbidden. Required role: Business User


            Caller is authenticated but lacks `Action.USE` on the requested Data
            Mart.
        '404':
          description: Data Mart not visible in the caller’s project, or not published.
        '424':
          description: >-
            Storage dependency failed while preparing or reading Data Mart data.
            The response includes provider context such as storage type,
            provider message, provider status code, and provider reason when
            available.
        '503':
          description: The server is shutting down and cannot start a new HTTP Data stream.
      security:
        - X-OWOX-Authorization: []
      summary: Stream Data Mart data as NDJSON
      tags:
        - HTTP Data
  /api/external/http-data/reports/{reportId}.ndjson:
    get:
      description: >-
        Streams rows of a saved report as newline-delimited JSON (one data row
        per line, no envelope), applying the report’s stored output controls
        (columns, filters, aggregations, date buckets, unique count, sort). The
        only accepted query parameter is an optional `limit` override; any other
        query key is rejected. Authenticated with the ODM member token via
        `x-owox-authorization`. Successful executions and execution failures,
        including invalid saved output controls, create a DataMartRun tagged
        with the reportId. Invalid request query parameters create no run. When
        the report applies output controls or blends fields, the run also
        records the executed SQL under
        `additionalParams.httpData.executionSqlQuery`.
      operationId: HttpDataController_streamReport
      parameters:
        - name: reportId
          required: true
          in: path
          description: Report identifier (UUID)
          schema:
            type: string
        - name: limit
          required: false
          in: query
          description: >-
            Optional row cap (positive integer) overriding the report's saved
            limit.
          schema:
            type: number
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: >-
            NDJSON stream of the report’s row objects. The response includes the
            `x-owox-run-id` header with the created DataMartRun ID.
          headers:
            x-owox-run-id:
              description: ID of the created DataMartRun for traceability
              schema:
                type: string
          content:
            application/x-ndjson:
              schema:
                type: string
                example: |
                  {"date":"2026-05-01","revenue":42.5}
                  {"date":"2026-05-02","revenue":51.0}
        '400':
          description: >-
            An unsupported query parameter or invalid `limit` creates no run.
            Saved report output controls rejected during validation create a
            FAILED run. Storage rejections return 424. Project restrictions
            create a RESTRICTED run. No 400 response carries an `x-owox-run-id`
            header.
        '401':
          description: |-
            Missing or invalid `x-owox-authorization` token.

            Authentication required
        '403':
          description: >-
            Caller is authenticated but lacks `Action.USE` on the report’s Data
            Mart.


            Forbidden. Required role: Business User
        '404':
          description: >-
            Report not found in the caller’s project, or its Data Mart is not
            published.
        '424':
          description: >-
            Storage dependency failed while preparing or reading the report
            data. A FAILED run is recorded, including when storage rejects saved
            report configuration.
      security:
        - X-OWOX-Authorization: []
      summary: Stream an existing report's data as NDJSON
      tags:
        - HTTP Data
  /api/user-provisioning/request-access-context:
    get:
      description: >-
        Returns the current user, target project, available roles and existing
        pending request for users authenticated with an empty project-role
        token.
      operationId: RequestAccessController_getContext
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestAccessContextApiDto'
        '401':
          description: Authentication required
        '502':
          description: Upstream IDP failure
      security:
        - X-OWOX-Authorization: []
      summary: Get request-access context for the current project
      tags:
        - User Provisioning
  /api/user-provisioning/request-access:
    post:
      description: >-
        Creates or returns a pending project membership request for the
        authenticated user and selected role.
      operationId: RequestAccessController_requestAccess
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestProjectAccessApiDto'
      responses:
        '202':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestProjectAccessResponseApiDto'
        '400':
          description: Invalid requested role
        '401':
          description: Authentication required
        '413':
          description: Request body too large
        '502':
          description: Upstream IDP failure
      security:
        - X-OWOX-Authorization: []
      summary: Request access to the current project
      tags:
        - User Provisioning
  /api/user-provisioning/create-new-project:
    post:
      description: >-
        Creates a separate project for the authenticated user and returns the
        new project id/title.
      operationId: RequestAccessController_createNewProject
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateNewProjectApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateNewProjectResponseApiDto'
        '400':
          description: Invalid project creation integration
        '401':
          description: Authentication required
        '413':
          description: Request body too large
        '502':
          description: Upstream IDP failure
      security:
        - X-OWOX-Authorization: []
      summary: Create a new project instead of requesting access
      tags:
        - User Provisioning
  /api/credentials/definitions:
    get:
      operationId: CredentialsController_listDefinitions
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CredentialDefinitionApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
  /api/credentials/oauth/google/settings:
    get:
      operationId: CredentialsController_getGoogleOAuthSettings
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleOAuthCredentialSettingsApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
  /api/credentials/oauth/google/authorize:
    post:
      operationId: CredentialsController_authorizeGoogleOAuth
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthorizeGoogleOAuthCredentialApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleOAuthCredentialAuthorizationApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
  /api/credentials/oauth/google/exchange:
    post:
      operationId: CredentialsController_connectGoogleOAuth
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectGoogleOAuthCredentialApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
  /api/credentials:
    post:
      operationId: CredentialsController_create
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCredentialApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
    get:
      operationId: CredentialsController_list
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/CredentialResponseApiDto'
                    - $ref: '#/components/schemas/UnavailableCredentialResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
  /api/credentials/{id}:
    get:
      operationId: CredentialsController_get
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
    put:
      operationId: CredentialsController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCredentialApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
    delete:
      operationId: CredentialsController_delete
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '204':
          description: ''
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
  /api/credentials/{id}/definition-consent:
    post:
      operationId: CredentialsController_consentDefinition
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
  /api/credentials/{id}/validate:
    post:
      operationId: CredentialsController_validate
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
  /api/credential-setup:
    post:
      operationId: CredentialSetupController_start
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartCredentialSetupApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialSetupResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
  /api/credential-setup/{id}:
    get:
      operationId: CredentialSetupController_get
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialSetupResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
  /api/credential-setup/{id}/complete:
    post:
      operationId: CredentialSetupController_complete
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompleteCredentialSetupApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialSetupResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
  /api/credential-setup/{id}/cancel:
    post:
      operationId: CredentialSetupController_cancel
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialSetupResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
  /api/auth/api-keys/exchange:
    post:
      operationId: ApiKeyExchangeController_exchange
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExchangeProjectMemberApiKeyRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExchangeProjectMemberApiKeyResponseApiDto'
        '413':
          description: Request body too large
      summary: Exchange a project member API key for an ODM access token
      tags:
        - Project Member API Keys
  /api/intercom/jwt:
    post:
      operationId: IntercomController_issueJwt
      responses:
        '200':
          description: JWT token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntercomTokenResponseApiDto'
        '400':
          description: Missing INTERCOM_SECRET_KEY
        '401':
          description: |-
            Unauthorized

            Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Returns Intercom user verification JWT
      tags:
        - Intercom
  /api/auth/context:
    get:
      operationId: AuthContextController_getContext
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: Auth context resolved by the backend auth guard.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthContextResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get the current auth context
      tags:
        - Authentication
  /oauth/authorize:
    get:
      operationId: OAuthAuthorizationController_authorize
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - OAuthAuthorization
  /oauth/jwks:
    get:
      operationId: OAuthJwksController_getJwks
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - OAuthJwks
  /.well-known/oauth-authorization-server:
    get:
      operationId: OAuthMetadataController_getAuthorizationServerMetadata[0]
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - OAuthMetadata
  /.well-known/oauth-authorization-server/mcp:
    get:
      operationId: OAuthMetadataController_getAuthorizationServerMetadata[1]
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - OAuthMetadata
  /mcp/.well-known/oauth-authorization-server:
    get:
      operationId: OAuthMetadataController_getAuthorizationServerMetadata[2]
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - OAuthMetadata
  /api/.well-known/openid-configuration:
    get:
      operationId: OAuthMetadataController_getOpenIdConfigurationMetadata[0]
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - OAuthMetadata
  /api/.well-known/openid-configuration/mcp:
    get:
      operationId: OAuthMetadataController_getOpenIdConfigurationMetadata[1]
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - OAuthMetadata
  /mcp/.well-known/openid-configuration:
    get:
      operationId: OAuthMetadataController_getOpenIdConfigurationMetadata[2]
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - OAuthMetadata
  /oauth/register:
    post:
      operationId: OAuthRegistrationController_register
      parameters: []
      responses:
        '201':
          description: ''
      tags:
        - OAuthRegistration
  /oauth/token:
    post:
      operationId: OAuthTokenController_token
      parameters: []
      responses:
        '201':
          description: ''
      tags:
        - OAuthToken
  /api/search:
    get:
      description: >-
        Returns data marts, data storages, data destinations, and reports
        visible to the caller. Report results also carry their data mart,
        destination, and a canonical direct URL. Search uses semantic and
        keyword signals and falls back to keyword matching when prompt
        embeddings are unavailable.
      operationId: SearchController_search
      parameters:
        - name: q
          required: true
          in: query
          description: >-
            Search query. Surrounding whitespace is trimmed, and the server
            enforces its configured minimum and maximum query lengths.
          schema:
            example: monthly revenue by channel
            type: string
        - name: limit
          required: false
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 50
          description: >-
            Maximum number of results to return (1-50). When omitted, the
            server-configured default is used.
        - name: entityTypes
          required: false
          in: query
          style: form
          explode: false
          description: >-
            Restrict results to the given entity types (comma-separated). When
            omitted, all supported entity types are searched.
          schema:
            type: array
            items:
              type: string
              enum:
                - DATA_MART
                - DATA_STORAGE
                - DATA_DESTINATION
                - REPORT
        - name: excludeDrafts
          required: false
          in: query
          description: >-
            When true, exclude draft data marts from results. When omitted or
            false, drafts may be included.
          schema:
            example: true
            type: boolean
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SearchResultResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Search project entities
      tags:
        - Search
  /.well-known/oauth-protected-resource:
    get:
      operationId: McpMetadataController_getProtectedResourceMetadata[0]
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - McpMetadata
  /.well-known/oauth-protected-resource/mcp:
    get:
      operationId: McpMetadataController_getProtectedResourceMetadata[1]
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - McpMetadata
  /mcp/.well-known/oauth-protected-resource:
    get:
      operationId: McpMetadataController_getProtectedResourceMetadata[2]
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - McpMetadata
  /.well-known/openai-apps-challenge:
    get:
      operationId: McpMetadataController_getOpenaiAppsChallenge
      parameters: []
      responses:
        '200':
          description: ''
      tags:
        - McpMetadata
  /api/projects/settings:
    get:
      operationId: ProjectSettingsController_getSettings
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: The current project settings.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectSettingsResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get project settings
      tags:
        - ProjectSettings
  /api/projects/settings/description:
    put:
      operationId: ProjectSettingsController_updateDescription
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProjectDescriptionApiDto'
      responses:
        '200':
          description: The updated project settings.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectSettingsResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update the project description
      tags:
        - ProjectSettings
  /api/license-keys:
    get:
      operationId: LicenseKeyController_list
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - License Keys
    post:
      operationId: LicenseKeyController_create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLicenseKeyRequestDto'
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - License Keys
  /api/license-keys/{licenseKeyId}:
    patch:
      operationId: LicenseKeyController_update
      parameters:
        - name: licenseKeyId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLicenseKeyRequestDto'
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - License Keys
    delete:
      operationId: LicenseKeyController_revoke
      parameters:
        - name: licenseKeyId
          required: true
          in: path
          schema:
            type: string
      responses:
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Project Admin'
      security:
        - X-OWOX-Authorization: []
      tags:
        - License Keys
  /api/projects/notification-settings:
    get:
      operationId: ProjectNotificationSettingsController_getSettings
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationSettingsResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get notification settings for a project
      tags:
        - ProjectNotificationSettings
  /api/projects/notification-settings/members:
    get:
      operationId: ProjectNotificationSettingsController_getProjectMembers
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectMembersResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Get project members for receiver selection
      tags:
        - ProjectNotificationSettings
  /api/projects/notification-settings/{notificationType}:
    put:
      operationId: ProjectNotificationSettingsController_updateSetting
      parameters:
        - name: notificationType
          required: true
          in: path
          description: Notification type
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateNotificationSettingApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationSettingsItemResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Update a specific notification setting
      tags:
        - ProjectNotificationSettings
  /api/projects/notification-settings/{notificationType}/test-webhook:
    post:
      operationId: ProjectNotificationSettingsController_testWebhook
      parameters:
        - name: notificationType
          required: true
          in: path
          description: Notification type
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                webhookUrl:
                  type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Data Owner'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Send a test webhook for a notification type
      tags:
        - ProjectNotificationSettings
  /api/plugins/runtime/collections/{collectionName}/documents:
    get:
      operationId: PluginCollectionsController_list
      parameters:
        - name: collectionName
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginCollectionPageApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin collections
  /api/plugins/runtime/collections/{collectionName}/documents/{documentId}:
    get:
      operationId: PluginCollectionsController_get
      parameters:
        - name: collectionName
          required: true
          in: path
          schema:
            type: string
        - name: documentId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginCollectionDocumentApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin collections
    put:
      operationId: PluginCollectionsController_put
      parameters:
        - name: collectionName
          required: true
          in: path
          schema:
            type: string
        - name: documentId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PutPluginCollectionDocumentApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginCollectionDocumentApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin collections
    delete:
      operationId: PluginCollectionsController_delete
      parameters:
        - name: collectionName
          required: true
          in: path
          schema:
            type: string
        - name: documentId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '204':
          description: ''
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin collections
  /api/credentials/definitions/github:
    post:
      operationId: CredentialDefinitionsGithubController_add
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddGithubCredentialDefinitionApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialDefinitionApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Credentials
  /api/plugins/runtime/credentials/{handle}/fetch:
    post:
      operationId: PluginCredentialRuntimeController_fetch
      parameters:
        - name: handle
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialFetchRequestApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialFetchResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Credentials
  /api/plugins/runtime/credentials/{handle}/ai/generate:
    post:
      operationId: PluginCredentialRuntimeController_generate
      parameters:
        - name: handle
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialAiRequestApiDto'
      responses:
        '200':
          description: Portable Vercel AI SDK LanguageModelV4 generate result.
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Credentials
  /api/plugins/runtime/credentials/{handle}/ai/embed:
    post:
      operationId: PluginCredentialRuntimeController_embed
      parameters:
        - name: handle
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialAiRequestApiDto'
      responses:
        '200':
          description: Portable Vercel AI SDK EmbeddingModelV4 result.
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Credentials
  /api/plugins/runtime/credentials/{handle}/ai/stream:
    post:
      operationId: PluginCredentialRuntimeController_stream
      parameters:
        - name: handle
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CredentialAiRequestApiDto'
      responses:
        '201':
          description: ''
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Credentials
  /api/plugins/runtime/actions/{action}/executions:
    post:
      operationId: PluginActionRuntimeController_start
      parameters:
        - name: action
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartPluginActionExecutionApiDto'
      responses:
        '202':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StartedPluginActionExecutionApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Actions
  /api/plugins/runtime/executions/current:
    get:
      operationId: PluginActionRuntimeController_current
      parameters:
        - name: capabilities
          required: false
          in: query
          description: What the calling SDK supports. `ai` adds the AI Credential handles.
          schema:
            example: ai
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginActionWorkerContextApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Actions
  /api/plugins/runtime/executions/{id}:
    get:
      operationId: PluginActionRuntimeController_get
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: waitSeconds
          required: false
          in: query
          description: >-
            Holds the answer until the execution ends or the time passes. Above
            20, 20 is used.
          schema:
            minimum: 0
            default: 0
            type: integer
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginActionExecutionApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Actions
  /api/plugins/runtime/executions/{id}/cancel:
    post:
      operationId: PluginActionRuntimeController_cancel
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginActionExecutionApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Actions
  /api/plugins/runtime/schedules:
    post:
      operationId: PluginScheduleRuntimeController_create
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePluginScheduleApiDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginScheduleApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Schedules
    get:
      operationId: PluginScheduleRuntimeController_list
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginScheduleListApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Schedules
  /api/plugins/runtime/schedules/{id}:
    get:
      operationId: PluginScheduleRuntimeController_get
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginScheduleApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Schedules
    patch:
      operationId: PluginScheduleRuntimeController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePluginScheduleApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginScheduleApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Schedules
    delete:
      operationId: PluginScheduleRuntimeController_delete
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '204':
          description: ''
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Schedules
  /api/plugins/runtime/schedules/{id}/pause:
    post:
      operationId: PluginScheduleRuntimeController_pause
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginScheduleApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Schedules
  /api/plugins/runtime/schedules/{id}/resume:
    post:
      operationId: PluginScheduleRuntimeController_resume
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginScheduleApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      tags:
        - Plugin Schedules
  /api/plugins/publications:
    post:
      operationId: PluginPublicationsController_publish
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishPluginApiDto'
      responses:
        '200':
          description: The publication, after being created or restored.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicationResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Publish a plugin to the Gallery at one authority level
      tags:
        - Plugins
    get:
      operationId: PluginPublicationsController_list
      parameters:
        - name: scope
          required: true
          in: query
          schema:
            enum:
              - deployment
              - project
              - member
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PublicationResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: List the publications the caller may manage at one scope
      tags:
        - Plugins
  /api/plugins/publications/unpublish:
    post:
      description: >-
        Catalog-only. Installations are untouched, the plugin is not suspended,
        and other publications may keep it visible.
      operationId: PluginPublicationsController_unpublish
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishPluginApiDto'
      responses:
        '200':
          description: The publication, after deactivation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicationResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Remove a plugin listing, or part of a deployment audience
      tags:
        - Plugins
  /api/plugins/suspend:
    post:
      description: >-
        Blocks opening, installing and restoring. Uninstalling and updating stay
        available, publications and installations are untouched, and the Gallery
        keeps listing the plugin as temporarily unavailable. Soft and
        idempotent.
      operationId: PluginAdminController_suspend
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SuspendPluginApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginSuspensionResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Suspend a plugin across the whole deployment
      tags:
        - Plugins
  /api/plugins/resume:
    post:
      description: >-
        Re-enables active installations on whatever version is current now,
        which may have moved on during the suspension because updates stay
        available throughout it.
      operationId: PluginAdminController_resume
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SuspendPluginApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginSuspensionResponseApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Lift a suspension
      tags:
        - Plugins
  /api/plugins/check:
    post:
      description: >-
        Dry run: reports whether a release from this ref would be accepted,
        using the same rules as release sync, and records nothing. For
        deployment publishers and members who manage a publication of the
        plugin. Verifies that the repository is still the one the plugin was
        published from. Rate-limited per plugin and caller, separately from
        Check now.
      operationId: PluginReleaseCheckController_check
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckPluginReleaseApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginReleaseCheckResultApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Check a release before publishing it
      tags:
        - Plugins
  /api/plugins/installations:
    get:
      description: >-
        With includeUninstalled, this is the installation history -- and the
        only route back to a plugin whose publication has since been withdrawn,
        because such a plugin no longer appears in the Gallery.
      operationId: PluginInstallationsController_list
      parameters:
        - name: includeUninstalled
          required: false
          in: query
          schema:
            type: boolean
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/InstalledPluginApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: The caller's installations in this project
      tags:
        - Plugins
  /api/plugins/installations/{installationId}/entry:
    get:
      description: >-
        The only member-facing response carrying a delivery URL, and only for
        the caller's own live installation. It is a runtime bootstrap rather
        than a product view.
      operationId: PluginInstallationsController_entry
      parameters:
        - name: installationId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginEntryApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Where to point the iframe for one active installation
      tags:
        - Plugins
  /api/plugins/installations/{installationId}/credential-selections:
    get:
      description: >-
        Only for the caller's own live installation, and only grants made for
        the current version's requirements. The granted Credential may since
        have been disabled or deleted. Refuses plugin runtime tokens.
      operationId: PluginInstallationsController_credentialSelections
      parameters:
        - name: installationId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginCredentialSelectionsApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Which Credential each requirement of one active installation is granted
      tags:
        - Plugins
  /api/plugins/installations/{installationId}/runtime-token:
    post:
      operationId: PluginInstallationsController_runtimeToken
      parameters:
        - name: installationId
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginRuntimeTokenApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Issue a runtime access token for one active installation
      tags:
        - Plugins
  /api/plugins/{pluginId}/installation:
    post:
      description: >-
        expectedVersionId must match the version the member was shown; if the
        plugin moved on in the meantime the confirmation is rejected and the new
        version returned.
      operationId: PluginInstallationsController_install
      parameters:
        - name: pluginId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InstallPluginApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginInstallationApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Install or restore a plugin for the caller
      tags:
        - Plugins
    delete:
      description: >-
        Soft: the record and its history survive so it can be restored later.
        Changes no publication, affects no other member, and stays available
        while the plugin is suspended.
      operationId: PluginInstallationsController_uninstall
      parameters:
        - name: pluginId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '204':
          description: ''
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Stop a plugin for the caller
      tags:
        - Plugins
  /api/plugins/update:
    post:
      description: >-
        CLI / api-client form of Check now. Same rules as the per-plugin route.
        Uses cached repository identity; the plugin must already be known to
        this deployment.
      operationId: PluginInstallationsController_updateByRepository
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePluginByRepositoryApiDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginUpdateResultApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
        '413':
          description: Request body too large
      security:
        - X-OWOX-Authorization: []
      summary: Check now, by repository
      tags:
        - Plugins
  /api/plugins/{pluginId}/update:
    post:
      description: >-
        Accelerates the deployment's daily update check rather than deciding it:
        a valid higher version becomes current immediately for every active
        installation in every project, and the plugin's own daily slot does not
        move. Available while the plugin is suspended, but does not lift a
        suspension. Rate-limited per plugin and safe to repeat.
      operationId: PluginInstallationsController_update
      parameters:
        - name: pluginId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginUpdateResultApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Check now
      tags:
        - Plugins
  /api/plugins/history:
    get:
      description: >-
        Newest first: the caller's own installations, publications for this
        project and the caller's own, Verified listing changes, and updates and
        suspensions of those plugins. A Verified listing change shows for every
        project the listing is set to reach or has ever named. Events within the
        same second may come in either order.
      operationId: PluginHistoryController_list
      parameters:
        - name: type
          required: false
          in: query
          schema:
            default: all
            type: string
            enum:
              - all
              - installations
              - publications
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 100
            default: 50
            type: integer
        - name: cursor
          required: false
          in: query
          description: nextCursor of the previous page.
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginHistoryPageApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: The caller's plugin history in this project
      tags:
        - Plugins
  /api/plugins/schedules:
    get:
      description: >-
        A project admin gets the schedules of every installation in the project;
        anyone else gets their own installations', uninstalled ones included.
        installationId narrows to one installation the caller can see, and any
        other reads as empty. Parameters are left out.
      operationId: ProjectPluginSchedulesController_list
      parameters:
        - name: limit
          required: false
          in: query
          description: Default and maximum 100.
          schema:
            type: number
        - name: offset
          required: false
          in: query
          schema:
            type: number
        - name: installationId
          required: false
          in: query
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectPluginScheduleListApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Plugin schedules in this project
      tags:
        - Plugins
  /api/plugins/schedules/{id}/pause:
    post:
      description: >-
        Cancels its queued run; a running one continues. A paused schedule stays
        paused. A project admin's pause of another member's schedule sets
        disabledReason PAUSED_BY_ADMIN, which the plugin cannot resume.
      operationId: ProjectPluginSchedulesController_pause
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectPluginScheduleApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Pause a plugin schedule
      tags:
        - Plugins
  /api/plugins/schedules/{id}/resume:
    post:
      description: >-
        Checks the schedule against the plugin's current version first; a
        refusal leaves it as it was. Clears disabledReason, PAUSED_BY_ADMIN
        included. Its runs keep the access of the member who created it, whoever
        resumed it.
      operationId: ProjectPluginSchedulesController_resume
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectPluginScheduleApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Resume a paused or disabled plugin schedule
      tags:
        - Plugins
  /api/plugins/schedules/{id}:
    delete:
      description: Cancels its queued run; a running one continues.
      operationId: ProjectPluginSchedulesController_delete
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '204':
          description: ''
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Delete a plugin schedule
      tags:
        - Plugins
  /api/plugins/runs:
    get:
      description: >-
        Newest first, ties by id. A project admin gets every run in the project
        and may narrow by userId; anyone else gets their own installations'
        runs, and userId is ignored. Input and result are left out.
      operationId: ProjectPluginRunsController_list
      parameters:
        - name: cursor
          required: false
          in: query
          description: nextCursor of the previous page.
          schema:
            type: string
        - name: limit
          required: false
          in: query
          schema:
            minimum: 1
            maximum: 50
            default: 50
            type: integer
        - name: status
          required: false
          in: query
          description: 'Repeat the key for several: status=FAILED&status=TIMED_OUT.'
          schema:
            type: array
            items:
              type: string
              enum:
                - QUEUED
                - RUNNING
                - SUCCEEDED
                - FAILED
                - CANCELLED
                - TIMED_OUT
        - name: trigger
          required: false
          in: query
          schema:
            type: string
            enum:
              - frontend
              - schedule
        - name: pluginId
          required: false
          in: query
          schema:
            type: string
        - name: scheduleId
          required: false
          in: query
          schema:
            type: string
        - name: userId
          required: false
          in: query
          description: The owner to narrow to; honoured for project admins only.
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginRunListApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Plugin action runs in this project
      tags:
        - Plugins
  /api/plugins/runs/{id}:
    get:
      operationId: ProjectPluginRunsController_get
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginRunApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: One plugin action run
      tags:
        - Plugins
  /api/plugins/runs/{id}/cancel:
    post:
      description: A run that already finished keeps its outcome and is returned as it is.
      operationId: ProjectPluginRunsController_cancel
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginRunApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Cancel a queued or running plugin action run
      tags:
        - Plugins
  /api/plugins/gallery:
    get:
      description: >-
        Combines deployment, project and member publications into one
        deduplicated list. A plugin exposed at several levels appears once.
      operationId: PluginGalleryController_gallery
      parameters:
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PluginGalleryEntryApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: Plugins visible to the current member in the current project
      tags:
        - Plugins
  /api/plugins/lookup:
    get:
      description: >-
        Resolves owner/name or a GitHub URL to the id of a public plugin whose
        deployment publication reaches the caller's project: all projects, or a
        selected audience that includes it. Any other repository, private,
        unknown or outside the audience, answers 404 alike.
      operationId: PluginGalleryController_lookup
      parameters:
        - name: repository
          required: true
          in: query
          schema:
            example: OWOX/odm-usage-stat
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginLookupApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: A public plugin by its GitHub repository
      tags:
        - Plugins
  /api/plugins/{pluginId}:
    get:
      description: >-
        A direct link is a discovery path in its own right, so this resolves
        even when no publication makes the plugin visible to the caller.
      operationId: PluginGalleryController_details
      parameters:
        - name: pluginId
          required: true
          in: path
          schema:
            type: string
        - name: X-OWOX-Api-Key-Id
          in: header
          required: false
          description: >-
            Required when X-OWOX-Authorization contains an API-key access token;
            must match the token API key ID.
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PluginGalleryEntryApiDto'
        '401':
          description: Authentication required
        '403':
          description: 'Forbidden. Required role: Business User'
      security:
        - X-OWOX-Authorization: []
      summary: One plugin, by id
      tags:
        - Plugins
info:
  title: OWOX Data Marts API
  description: REST API used by frontend clients and service integrations.
  version: '1.0'
  contact: {}
tags: []
servers: []
components:
  securitySchemes:
    X-OWOX-Authorization:
      type: apiKey
      in: header
      name: X-OWOX-Authorization
      description: OWOX access token using the Bearer scheme.
  schemas:
    BatchRunDataQualityRequestApiDto:
      type: object
      properties:
        dataMartIds:
          type: array
          items:
            type: string
      required:
        - dataMartIds
    DataQualityBatchRunSuccessApiDto:
      type: object
      properties:
        dataMartId:
          type: string
        status:
          type: string
          enum:
            - SUCCESS
        runId:
          type: string
          format: uuid
      required:
        - dataMartId
        - status
        - runId
    DataQualityBatchRunErrorApiDto:
      type: object
      properties:
        dataMartId:
          type: string
        status:
          type: string
          enum:
            - ERROR
        code:
          type: string
          enum:
            - NOT_FOUND_OR_FORBIDDEN
            - NOT_ELIGIBLE
            - ACTIVE_RUN
            - INTERNAL_ERROR
        message:
          type: string
        activeRunId:
          type: object
          format: uuid
          nullable: true
      required:
        - dataMartId
        - status
        - code
        - message
    BatchRunDataQualityResponseApiDto:
      type: object
      properties:
        items:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/DataQualityBatchRunSuccessApiDto'
              - $ref: '#/components/schemas/DataQualityBatchRunErrorApiDto'
            discriminator:
              propertyName: status
      required:
        - items
    GetDataQualitySummariesRequestApiDto:
      type: object
      properties:
        dataMartIds:
          type: array
          items:
            type: string
      required:
        - dataMartIds
    CompactDataQualitySummaryApiDto:
      type: object
      properties:
        state:
          type: string
          enum:
            - NEVER_RUN
            - QUEUED
            - RUNNING
            - PASSED
            - ISSUES
            - EXECUTION_FAILED
            - RESTRICTED
            - CANCELLED
            - ALL_DISABLED
        enabledChecks:
          type: number
        totalChecks:
          type: number
        passedChecks:
          type: number
        failedChecks:
          type: number
        notApplicableChecks:
          type: number
        errorChecks:
          type: number
        noticeFindings:
          type: number
        warningFindings:
          type: number
        errorFindings:
          type: number
        violationCount:
          type: number
        highestSeverity:
          type: string
          enum:
            - notice
            - warning
            - error
          nullable: true
        dataMartRunId:
          type: object
          format: uuid
          nullable: true
        lastRunAt:
          type: string
          format: date-time
          nullable: true
      required:
        - state
        - enabledChecks
        - totalChecks
        - passedChecks
        - failedChecks
        - notApplicableChecks
        - errorChecks
        - noticeFindings
        - warningFindings
        - errorFindings
        - violationCount
        - highestSeverity
        - dataMartRunId
        - lastRunAt
    DataQualitySummaryItemApiDto:
      type: object
      properties:
        dataMartId:
          type: string
          format: uuid
        summary:
          $ref: '#/components/schemas/CompactDataQualitySummaryApiDto'
      required:
        - dataMartId
        - summary
    GetDataQualitySummariesResponseApiDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DataQualitySummaryItemApiDto'
      required:
        - items
    DataQualityScopeApiDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - DATA_MART
            - FIELD
            - RELATIONSHIP
        fieldPath:
          type: array
          items:
            type: string
        relationshipId:
          type: string
      required:
        - type
    DataQualityCheckParametersApiDto:
      type: object
      properties:
        thresholdPercent:
          type: number
          minimum: 0
          maximum: 100
        thresholdHours:
          type: number
          minimum: 0
    DataQualityRuleConfigApiDto:
      type: object
      properties:
        key:
          type: string
        category:
          type: string
          enum:
            - pk_uniqueness
            - duplicate_rows
            - null_rate
            - column_uniqueness
            - constant_column
            - empty_table
            - type_mismatch
            - data_freshness
            - negative_values
            - relationship_integrity
            - reverse_relationship
        scope:
          $ref: '#/components/schemas/DataQualityScopeApiDto'
        severity:
          type: string
          enum:
            - notice
            - warning
            - error
        enabled:
          type: boolean
        parameters:
          $ref: '#/components/schemas/DataQualityCheckParametersApiDto'
      required:
        - key
        - category
        - scope
        - severity
        - enabled
        - parameters
    DataQualityConfigValueApiDto:
      type: object
      properties:
        rules:
          type: array
          items:
            $ref: '#/components/schemas/DataQualityRuleConfigApiDto'
      required:
        - rules
    EffectiveDataQualityRuleConfigApiDto:
      type: object
      properties:
        key:
          type: string
        category:
          type: string
          enum:
            - pk_uniqueness
            - duplicate_rows
            - null_rate
            - column_uniqueness
            - constant_column
            - empty_table
            - type_mismatch
            - data_freshness
            - negative_values
            - relationship_integrity
            - reverse_relationship
        scope:
          $ref: '#/components/schemas/DataQualityScopeApiDto'
        severity:
          type: string
          enum:
            - notice
            - warning
            - error
        enabled:
          type: boolean
        parameters:
          $ref: '#/components/schemas/DataQualityCheckParametersApiDto'
        isApplicable:
          type: boolean
        notApplicableReason:
          type: string
      required:
        - key
        - category
        - scope
        - severity
        - enabled
        - parameters
        - isApplicable
    EffectiveDataQualityConfigValueApiDto:
      type: object
      properties:
        rules:
          type: array
          items:
            $ref: '#/components/schemas/EffectiveDataQualityRuleConfigApiDto'
      required:
        - rules
    DataQualityRelationshipJoinConditionApiDto:
      type: object
      properties:
        sourceFieldName:
          type: string
          example: customer_id
        targetFieldName:
          type: string
          example: id
      required:
        - sourceFieldName
        - targetFieldName
    DataQualityRelationshipMetadataApiDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        targetAlias:
          type: string
          example: customers
        joinConditions:
          type: array
          items:
            $ref: '#/components/schemas/DataQualityRelationshipJoinConditionApiDto'
      required:
        - id
        - targetAlias
        - joinConditions
    DataQualityRunEligibilityApiDto:
      type: object
      properties:
        eligible:
          type: boolean
        code:
          type: string
          enum:
            - NOT_PUBLISHED
            - OUTPUT_SCHEMA_REQUIRED
            - DEFINITION_REQUIRED
            - NO_APPLICABLE_CHECKS
            - ACTIVE_RUN
          nullable: true
        activeRunId:
          type: object
          format: uuid
          nullable: true
      required:
        - eligible
        - code
        - activeRunId
    DataQualityConfigResponseApiDto:
      type: object
      properties:
        source:
          type: string
          enum:
            - DEFAULT
            - SAVED
        savedConfig:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/DataQualityConfigValueApiDto'
        effectiveConfig:
          $ref: '#/components/schemas/EffectiveDataQualityConfigValueApiDto'
        configRevision:
          type: string
          pattern: ^[0-9a-f]{64}$
        relationships:
          type: array
          items:
            $ref: '#/components/schemas/DataQualityRelationshipMetadataApiDto'
        canEdit:
          type: boolean
        canRun:
          type: boolean
        runEligibility:
          $ref: '#/components/schemas/DataQualityRunEligibilityApiDto'
      required:
        - source
        - savedConfig
        - effectiveConfig
        - configRevision
        - relationships
        - canEdit
        - canRun
        - runEligibility
    RunDataQualityRequestApiDto:
      type: object
      properties:
        configRevision:
          type: string
          pattern: ^[0-9a-f]{64}$
    RunDataQualityResponseApiDto:
      type: object
      properties:
        runId:
          type: string
          format: uuid
      required:
        - runId
    DataQualitySummaryApiDto:
      type: object
      properties:
        state:
          type: string
          enum:
            - NEVER_RUN
            - QUEUED
            - RUNNING
            - PASSED
            - ISSUES
            - EXECUTION_FAILED
            - RESTRICTED
            - CANCELLED
            - ALL_DISABLED
        enabledChecks:
          type: number
        totalChecks:
          type: number
        passedChecks:
          type: number
        failedChecks:
          type: number
        notApplicableChecks:
          type: number
        errorChecks:
          type: number
        noticeFindings:
          type: number
        warningFindings:
          type: number
        errorFindings:
          type: number
        violationCount:
          type: number
        highestSeverity:
          type: string
          enum:
            - notice
            - warning
            - error
          nullable: true
      required:
        - state
        - enabledChecks
        - totalChecks
        - passedChecks
        - failedChecks
        - notApplicableChecks
        - errorChecks
        - noticeFindings
        - warningFindings
        - errorFindings
        - violationCount
        - highestSeverity
    LatestDataQualityRunResponseApiDto:
      type: object
      properties:
        runId:
          type: string
          format: uuid
        summary:
          $ref: '#/components/schemas/DataQualitySummaryApiDto'
        createdAt:
          type: string
          format: date-time
        startedAt:
          type: string
          format: date-time
          nullable: true
        finishedAt:
          type: string
          format: date-time
          nullable: true
      required:
        - runId
        - summary
        - createdAt
        - startedAt
        - finishedAt
    DataMartRunStatus:
      type: string
      enum:
        - PENDING
        - RUNNING
        - SUCCESS
        - FAILED
        - CANCELLED
        - INTERRUPTED
        - RESTRICTED
      description: Current run lifecycle status.
    DataMartRunType:
      type: string
      enum:
        - CONNECTOR
        - GOOGLE_SHEETS_EXPORT
        - LOOKER_STUDIO
        - EXCEL
        - EMAIL
        - SLACK
        - MS_TEAMS
        - GOOGLE_CHAT
        - INSIGHT
        - INSIGHT_TEMPLATE
        - AI_ASSISTANT
        - HTTP_DATA
        - MCP_QUERY
        - DATA_QUALITY
      description: Execution category that produced the run.
    RunType:
      type: string
      enum:
        - manual
        - scheduled
      description: Run trigger type (manual, scheduled)
    ProjectDataMartRunRefResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: a5c9b1d2-3456-7890-abcd-ef0123456789
          description: Identifier of the Data Mart that produced the run.
        title:
          type: string
          example: Marketing performance
          description: Current title of the Data Mart that produced the run.
      required:
        - id
        - title
    ProjectDataMartRunUserResponseApiDto:
      type: object
      properties:
        userId:
          type: string
          example: 44c7b3e4-5d6f-7a8b-9c0d-112233445566
          description: Run author user identifier.
        fullName:
          type: string
          example: Ada Lovelace
          description: Run author full name when available.
          nullable: true
        email:
          type: string
          example: ada@example.com
          description: Run author email address when available.
          nullable: true
          format: email
        avatar:
          type: string
          example: https://example.com/avatar.png
          description: Run author avatar URL when available.
          nullable: true
          format: uri
      required:
        - userId
    ProjectDataMartRunResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 0b0f5a1e-6f66-4a7d-8b8d-123456789abc
        status:
          example: SUCCESS
          description: Current run lifecycle status.
          allOf:
            - $ref: '#/components/schemas/DataMartRunStatus'
        type:
          example: CONNECTOR
          description: Execution category that produced the run.
          allOf:
            - $ref: '#/components/schemas/DataMartRunType'
        runType:
          example: manual
          description: Run trigger type (manual, scheduled)
          allOf:
            - $ref: '#/components/schemas/RunType'
        dataMartId:
          type: string
          example: a5c9b1d2-3456-7890-abcd-ef0123456789
        definitionRun:
          type: object
          additionalProperties: true
          example:
            connector:
              source:
                name: Example
          description: >-
            Masked definition snapshot at run time. Null when a historical
            snapshot is unavailable.
          nullable: true
        reportId:
          type: string
          example: 44c7b3e4-5d6f-7a8b-9c0d-112233445566
          nullable: true
        reportDefinition:
          type: object
          additionalProperties: true
          example:
            title: Quarterly export
            destination:
              type: GOOGLE_SHEETS
            executionSqlQuery: >-
              SELECT * FROM (SELECT * FROM `proj.ds.sales`) WHERE created_at >=
              DATE '2025-01-01'
          nullable: true
        insightId:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef0123456789
          nullable: true
        insightDefinition:
          type: object
          additionalProperties: true
          example:
            title: Analysis Q4 2025
            template: Template text with prompts
          nullable: true
        insightTemplateId:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef0123456789
          nullable: true
        insightTemplateDefinition:
          type: object
          additionalProperties: true
          example:
            title: Summary
            template: '### Summary\n{{table source="main"}}'
            sources:
              - key: main
                type: CURRENT_DATA_MART
                kind: TABLE
          nullable: true
        aiSourceDefinition:
          type: object
          additionalProperties: true
          example:
            sessionId: e7f7e087-2042-4de0-b1fc-67dddbaf88dd
            scope: template
            route: full_generation
            templateId: 6f093b03-30c1-43e0-b9ed-6d87d33edf15
            artifactId: null
            turnId: 6742f3e8-1a02-4642-bbf4-e7f8710f9507
          nullable: true
        logs:
          example:
            - '{"type":"log","at":"2025-10-09T15:13:06.930Z","message":"Started"}'
          nullable: true
          type: array
          items:
            type: string
        errors:
          example:
            - '{"type":"error","at":"2025-10-09T15:14:06.930Z","error":"Failure"}'
          nullable: true
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
          example: '2025-10-09T15:13:06.930Z'
          description: RFC3339 timestamp when the run record was created.
        startedAt:
          type: string
          format: date-time
          example: '2025-10-09T15:14:06.930Z'
          description: >-
            RFC3339 timestamp when execution started, or null when it has not
            started.
          nullable: true
        finishedAt:
          type: string
          format: date-time
          example: '2025-10-09T15:20:06.930Z'
          description: RFC3339 timestamp when execution finished, or null while unfinished.
          nullable: true
        additionalParams:
          type: object
          additionalProperties: true
          example:
            httpData:
              format: ndjson
              columns:
                - date
              rowCount: 10
              completed: true
          description: >-
            Run-type-specific metadata captured by the use case (e.g. `httpData`
            for HTTP Data API runs)
          nullable: true
        totals:
          type: object
          additionalProperties:
            oneOf:
              - type: number
              - type: string
              - type: boolean
              - type: string
                nullable: true
                enum:
                  - null
          example:
            revenue | SUM: 1575.93
            revenue | AVG: 157.593
            country | COUNTUNIQUE: 18
          description: >-
            Grand-totals summary over the full filtered dataset (no grouping):
            every selected numeric field, plus any non-numeric field the report
            aggregates as a metric (e.g. COUNT_DISTINCT over a text column),
            each by its allowed aggregation functions. Covers native and joined
            fields. ANY_VALUE and STRING_AGG are excluded (not meaningful as a
            grand total). Null when the run produced no totals.
          nullable: true
        qualitySummary:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/CompactDataQualitySummaryApiDto'
        dataMart:
          description: Data Mart reference for this project-wide run-history entry.
          allOf:
            - $ref: '#/components/schemas/ProjectDataMartRunRefResponseApiDto'
        createdByUser:
          nullable: true
          description: >-
            Run author. Null when the run has no creator ID or the corresponding
            user projection is unavailable.
          type: object
          allOf:
            - $ref: '#/components/schemas/ProjectDataMartRunUserResponseApiDto'
      required:
        - id
        - status
        - type
        - runType
        - dataMartId
        - definitionRun
        - reportId
        - reportDefinition
        - insightId
        - insightDefinition
        - insightTemplateId
        - insightTemplateDefinition
        - aiSourceDefinition
        - logs
        - errors
        - createdAt
        - startedAt
        - finishedAt
        - additionalParams
        - totals
        - qualitySummary
        - dataMart
        - createdByUser
    ProjectDataMartRunsResponseApiDto:
      type: object
      properties:
        runs:
          description: Newest-first page of project-visible Data Mart runs.
          type: array
          items:
            $ref: '#/components/schemas/ProjectDataMartRunResponseApiDto'
      required:
        - runs
    StorageCredentialSummaryApiDto:
      type: object
      properties:
        access:
          type: string
          enum:
            - visible
            - restricted
            - pending
          description: >-
            pending: the Storage has no Credential yet and runs on its own key
            until a Credential is selected
        id:
          type: string
        title:
          type: string
        definitionId:
          type: string
          example: google-service-account
        providerName:
          type: string
          example: Google service account
        identity:
          type: string
          nullable: true
        state:
          type: string
          enum:
            - ready
            - disabled
            - not-configured
            - reconnect-required
            - reauthorize-required
            - deleted
            - unavailable
      required:
        - access
        - state
    UserProjectionDto:
      type: object
      properties:
        userId:
          type: string
          example: 540734f6-8eb1-48a9-bf86-22010d3bddfd
          description: User identifier.
        fullName:
          type: string
          example: Ada Lovelace
          description: User full name when available.
          nullable: true
        email:
          type: string
          example: ada@example.com
          description: User email address when available.
          nullable: true
        avatar:
          type: string
          example: https://example.com/avatar.png
          description: User avatar URL when available.
          nullable: true
      required:
        - userId
    ContextSummaryApiDto:
      type: object
      properties:
        id:
          type: string
          description: Context identifier
        name:
          type: string
          description: Context display name
        icon:
          type: string
          nullable: true
          example: lucide:megaphone
          description: >-
            Context icon: A recommended icon key (e.g. `purchases`) or any
            lucide icon as `lucide:<icon-name>` (e.g. `lucide:shopping-cart`).
            null means the default icon.
      required:
        - id
        - name
        - icon
    DataStorageResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: abc123e4-5678-90ab-cdef-1234567890ab
        title:
          type: string
          example: title
        type:
          type: string
          enum:
            - GOOGLE_BIGQUERY
            - AWS_ATHENA
            - SNOWFLAKE
            - AWS_REDSHIFT
            - DATABRICKS
            - LEGACY_GOOGLE_BIGQUERY
          example: GOOGLE_BIGQUERY
        projectId:
          type: string
          example: my-project
        config:
          type: object
          additionalProperties: true
        createdAt:
          format: date-time
          type: string
          example: '2024-01-01T12:00:00.000Z'
        modifiedAt:
          format: date-time
          type: string
          example: '2024-01-02T15:30:00.000Z'
        reusableCredential:
          nullable: true
          description: >-
            The Credential the Storage uses, as the member sees it; pending
            while the Storage runs on its own key; null when it has neither.
            Absent where a Storage is embedded in another resource.
          type: object
          allOf:
            - $ref: '#/components/schemas/StorageCredentialSummaryApiDto'
        createdByUser:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
        ownerUsers:
          type: array
          items:
            $ref: '#/components/schemas/UserProjectionDto'
        availableForUse:
          type: boolean
          example: true
        availableForMaintenance:
          type: boolean
          example: true
        contexts:
          type: array
          items:
            $ref: '#/components/schemas/ContextSummaryApiDto'
      required:
        - id
        - title
        - type
        - projectId
        - config
        - createdAt
        - modifiedAt
        - ownerUsers
        - availableForUse
        - availableForMaintenance
        - contexts
    DataMartSourceCredentialApiDto:
      type: object
      properties:
        configId:
          type: string
          description: The `_id` of the configuration item
        summary:
          description: >-
            State 'deleted', with access 'restricted', once the configuration's
            Credential was deleted, and 'unavailable' once its connector is no
            longer installed.
          allOf:
            - $ref: '#/components/schemas/StorageCredentialSummaryApiDto'
      required:
        - configId
        - summary
    ConnectorStateItemResponseApiDto:
      type: object
      properties:
        _id:
          type: string
          example: 2861dd75-6a3a-434e-86e6-e4757808ac9d
        state:
          type: object
          additionalProperties: true
          example:
            date: '2024-04-05T00:00:00.000Z'
        at:
          type: string
          example: '2025-10-31 11:39:44'
      required:
        - _id
        - state
        - at
    ConnectorStateResponseApiDto:
      type: object
      properties:
        state:
          type: object
          additionalProperties: true
        at:
          type: string
          example: '2025-10-31T11:39:44.377Z'
        states:
          type: array
          items:
            $ref: '#/components/schemas/ConnectorStateItemResponseApiDto'
    DataMartDataLastUpdatedSourceApiDto:
      type: object
      properties:
        table:
          type: string
          example: my-project.sales.orders
        dataLastUpdatedAt:
          type: string
          nullable: true
          example: '2026-07-25T08:30:00.000Z'
        note:
          type: string
          example: sharded table set — newest shard
      required:
        - table
        - dataLastUpdatedAt
    DataMartDataLastUpdatedResponseApiDto:
      type: object
      properties:
        dataLastUpdatedAt:
          type: string
          nullable: true
          example: '2026-07-25T08:30:00.000Z'
          description: >-
            When the newest source table last changed in the warehouse. This is
            a storage-level write time, not the period the data covers; null
            means unknown.
        computedAt:
          type: string
          example: '2026-07-28T10:00:00.000Z'
        coverage:
          type: string
          enum:
            - complete
            - partial
            - unavailable
          example: complete
        sources:
          type: array
          items:
            $ref: '#/components/schemas/DataMartDataLastUpdatedSourceApiDto'
      required:
        - dataLastUpdatedAt
        - computedAt
        - coverage
        - sources
    DataMartResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        title:
          type: string
          example: First Data Mart
        status:
          type: string
          enum:
            - DRAFT
            - PUBLISHED
          example: DRAFT
        storage:
          $ref: '#/components/schemas/DataStorageResponseApiDto'
        definitionType:
          type: string
          enum:
            - SQL
            - TABLE
            - VIEW
            - TABLE_PATTERN
            - CONNECTOR
          example: SQL
        definition:
          type: object
          description: >-
            A connector configuration item bound to a Credential carries its
            `_credential_id` and no key values.
        sourceCredentials:
          description: >-
            The Credential of each bound connector configuration, as the member
            sees it. A configuration whose Credential was deleted is listed as
            restricted with state deleted, and one whose connector is no longer
            installed with state unavailable.
          type: array
          items:
            $ref: '#/components/schemas/DataMartSourceCredentialApiDto'
        description:
          type: string
        icon:
          type: string
          nullable: true
          example: purchases
          description: >-
            User-picked icon: A recommended icon key (e.g. `purchases`) or any
            lucide icon as `lucide:<icon-name>` (e.g. `lucide:shopping-cart`).
            null means the default icon.
        schema:
          type: object
        connectorState:
          $ref: '#/components/schemas/ConnectorStateResponseApiDto'
        triggersCount:
          type: number
          example: 1
        reportsCount:
          type: number
          example: 2
        createdByUser:
          type: object
        businessOwnerUsers:
          type: array
          items:
            $ref: '#/components/schemas/UserProjectionDto'
        technicalOwnerUsers:
          type: array
          items:
            $ref: '#/components/schemas/UserProjectionDto'
        blendedFieldsConfig:
          type: object
        createdAt:
          format: date-time
          type: string
          example: '2024-01-01T12:00:00.000Z'
        modifiedAt:
          format: date-time
          type: string
          example: '2024-01-02T15:30:00.000Z'
        availableForReporting:
          type: boolean
          example: true
        availableForMaintenance:
          type: boolean
          example: true
        contexts:
          type: array
          items:
            $ref: '#/components/schemas/ContextSummaryApiDto'
        dataLastUpdated:
          nullable: true
          description: >-
            Last-known Data Last Updated snapshot for this DataMart, refreshed
            on user demand. Null when never computed.
          type: object
          allOf:
            - $ref: '#/components/schemas/DataMartDataLastUpdatedResponseApiDto'
      required:
        - id
        - title
        - status
        - storage
        - definitionType
        - definition
        - description
        - icon
        - schema
        - triggersCount
        - reportsCount
        - createdByUser
        - businessOwnerUsers
        - technicalOwnerUsers
        - createdAt
        - modifiedAt
        - availableForReporting
        - availableForMaintenance
        - contexts
        - dataLastUpdated
    DestinationCredentialSummaryApiDto:
      type: object
      properties:
        access:
          type: string
          enum:
            - visible
            - restricted
            - pending
          description: >-
            pending: the Destination has no Credential yet and runs on its own
            key until a Credential is selected
        id:
          type: string
        title:
          type: string
        definitionId:
          type: string
          example: google-service-account
        providerName:
          type: string
          example: Google Service Account
        identity:
          type: string
          nullable: true
          description: >-
            The service account or Google account email to share a sheet with; a
            restricted or pending Google Sheets summary carries it too
        state:
          type: string
          enum:
            - ready
            - disabled
            - not-configured
            - reconnect-required
            - reauthorize-required
      required:
        - access
        - state
    DataDestinationResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: abc123e4-5678-90ab-cdef-1234567890ab
        title:
          type: string
          example: My Google Sheets Destination
        type:
          type: string
          enum:
            - GOOGLE_SHEETS
            - LOOKER_STUDIO
            - EXCEL
            - EMAIL
            - SLACK
            - MS_TEAMS
            - GOOGLE_CHAT
          example: GOOGLE_SHEETS
        projectId:
          type: string
          example: my-project
        credentials:
          type: object
          additionalProperties: true
          description: >-
            Credentials without sensitive fields; empty for a plugin or when the
            Destination has no key. Google Sheets and Google Chat webhook
            Destinations show only the account or that a webhook is configured.
        createdAt:
          format: date-time
          type: string
          example: '2024-01-01T12:00:00.000Z'
        modifiedAt:
          format: date-time
          type: string
          example: '2024-01-02T15:30:00.000Z'
        credentialId:
          type: object
          example: abc123e4-5678-90ab-cdef-1234567890ab
          nullable: true
          description: >-
            The id of the credentials above. Absent for Google Sheets and Google
            Chat webhook delivery.
        reusableCredential:
          nullable: true
          description: >-
            The Credential a Google Sheets or Google Chat webhook Destination
            uses, as the member sees it; pending while it runs on its own key;
            null when it has neither. Absent for other types, Google Chat email
            delivery and plugins.
          type: object
          allOf:
            - $ref: '#/components/schemas/DestinationCredentialSummaryApiDto'
        createdByUser:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
        ownerUsers:
          type: array
          items:
            $ref: '#/components/schemas/UserProjectionDto'
        availableForUse:
          type: boolean
          example: true
        availableForMaintenance:
          type: boolean
          example: true
        contexts:
          type: array
          items:
            $ref: '#/components/schemas/ContextSummaryApiDto'
        config:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            Optional destination-level config (e.g. Google Drive folder for
            Google Sheets)
      required:
        - id
        - title
        - type
        - projectId
        - credentials
        - createdAt
        - modifiedAt
        - ownerUsers
        - availableForUse
        - availableForMaintenance
        - contexts
    ReportResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        title:
          type: string
          example: My Report
        dataMart:
          $ref: '#/components/schemas/DataMartResponseApiDto'
        dataDestinationAccess:
          $ref: '#/components/schemas/DataDestinationResponseApiDto'
        destinationConfig:
          type: object
          additionalProperties: true
          description: Configuration for the data destination
        columnConfig:
          nullable: true
          type: array
          items:
            type: string
        filterConfig:
          type: array
          nullable: true
          description: Filter rules
          items:
            type: object
        sortConfig:
          type: array
          nullable: true
          description: Sort rules
          items:
            type: object
        limitConfig:
          type: integer
          nullable: true
          description: Row limit
        aggregationConfig:
          type: array
          nullable: true
          description: Aggregation rules
          items:
            type: object
        dateTruncConfig:
          type: array
          nullable: true
          description: Date-trunc rules
          items:
            type: object
        uniqueCountConfig:
          nullable: true
          description: >-
            Unique Count sources. `true` (legacy) counts distinct primary keys
            of the main Data Mart; an array lists source alias paths, where an
            empty string denotes the main Data Mart.
          oneOf:
            - type: boolean
            - type: array
              items:
                type: string
        autoAggregationOptOut:
          type: array
          nullable: true
          maxItems: 500
          items:
            type: string
          description: >-
            Columns whose aggregation the analyst removed. While any of them is
            selected, the report is never collapsed automatically and returns
            its rows as stored. Omit to keep the stored value.
        lastRunAt:
          format: date-time
          type: string
          nullable: true
        lastRunStatus:
          type: string
          enum:
            - SUCCESS
            - ERROR
            - RUNNING
            - CANCELLED
            - RESTRICTED
          nullable: true
        lastRunError:
          type: string
          nullable: true
        runsCount:
          type: number
          example: 0
        createdAt:
          format: date-time
          type: string
          example: '2024-01-01T12:00:00.000Z'
        modifiedAt:
          format: date-time
          type: string
          example: '2024-01-02T15:30:00.000Z'
        createdByUser:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
        ownerUsers:
          type: array
          items:
            $ref: '#/components/schemas/UserProjectionDto'
        canRun:
          type: boolean
          example: true
          description: Whether the caller can manually run this report
        canManageTriggers:
          type: boolean
          example: true
          description: >-
            Whether the caller can create / edit / delete report triggers. Equal
            to canRun today.
        canEditConfig:
          type: boolean
          example: false
          description: >-
            Whether the caller can edit the report configuration (columns,
            filters, owners, destination)
      required:
        - id
        - title
        - dataMart
        - dataDestinationAccess
        - destinationConfig
        - lastRunAt
        - lastRunStatus
        - lastRunError
        - runsCount
        - createdAt
        - modifiedAt
        - ownerUsers
        - canRun
        - canManageTriggers
        - canEditConfig
    ProjectScheduledReportRunConfigResponseApiDto:
      type: object
      properties:
        type:
          type: object
          example: scheduled-report-run-config
        reportId:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        report:
          $ref: '#/components/schemas/ReportResponseApiDto'
      required:
        - type
        - reportId
    ProjectScheduledConnectorRunConfigResponseApiDto:
      type: object
      properties:
        type:
          type: object
          example: scheduled-connector-run-config
        connector:
          type: object
          additionalProperties: true
          description: Masked connector definition used by the connector run target.
      required:
        - type
    ProjectScheduledTriggerDataMartRefResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: a5c9b1d2-3456-7890-abcd-ef0123456789
        title:
          type: string
          example: Marketing performance
      required:
        - id
        - title
    ProjectScheduledTriggerResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        type:
          type: string
          enum:
            - REPORT_RUN
            - CONNECTOR_RUN
            - DATA_QUALITY_RUN
          example: CONNECTOR_RUN
        cronExpression:
          type: string
          example: 0 0 * * *
        timeZone:
          type: string
          example: UTC
        isActive:
          type: boolean
          example: true
        nextRunTimestamp:
          type: object
          example: '2024-01-01T12:00:00.000Z'
          nullable: true
        lastRunTimestamp:
          type: object
          example: '2024-01-01T12:00:00.000Z'
          nullable: true
        triggerConfig:
          oneOf:
            - $ref: '#/components/schemas/ProjectScheduledReportRunConfigResponseApiDto'
            - $ref: '#/components/schemas/ProjectScheduledConnectorRunConfigResponseApiDto'
          nullable: true
        createdById:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        createdAt:
          format: date-time
          type: string
          example: '2024-01-01T12:00:00.000Z'
        modifiedAt:
          format: date-time
          type: string
          example: '2024-01-02T15:30:00.000Z'
        createdByUser:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
        dataMart:
          $ref: '#/components/schemas/ProjectScheduledTriggerDataMartRefResponseApiDto'
        canEdit:
          type: boolean
          example: true
        canDelete:
          type: boolean
          example: true
      required:
        - id
        - type
        - cronExpression
        - timeZone
        - isActive
        - nextRunTimestamp
        - lastRunTimestamp
        - createdById
        - createdAt
        - modifiedAt
        - dataMart
        - canEdit
        - canDelete
    ProjectScheduledTriggersResponseApiDto:
      type: object
      properties:
        triggers:
          type: array
          items:
            $ref: '#/components/schemas/ProjectScheduledTriggerResponseApiDto'
      required:
        - triggers
    ProjectInsightTemplateDataMartRefResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: a5c9b1d2-3456-7890-abcd-ef0123456789
        title:
          type: string
          example: Marketing performance
      required:
        - id
        - title
    ProjectInsightTemplateResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: b1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890
        title:
          type: string
          example: Summary
        sourcesCount:
          type: number
          example: 1
          description: Number of configured sources in template
        lastRenderedTemplateUpdatedAt:
          type: object
          nullable: true
        createdById:
          type: string
          example: 540734f6-8eb1-48a9-bf86-22010d3bddfd
        createdAt:
          type: object
          example: '2026-02-14T15:13:06.930Z'
        modifiedAt:
          type: object
          example: '2026-02-14T15:13:06.930Z'
        createdByUser:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
        dataMart:
          $ref: '#/components/schemas/ProjectInsightTemplateDataMartRefResponseApiDto'
        canDelete:
          type: boolean
          example: true
      required:
        - id
        - title
        - sourcesCount
        - lastRenderedTemplateUpdatedAt
        - createdById
        - createdAt
        - modifiedAt
        - dataMart
        - canDelete
    ProjectInsightTemplatesResponseApiDto:
      type: object
      properties:
        insights:
          type: array
          items:
            $ref: '#/components/schemas/ProjectInsightTemplateResponseApiDto'
      required:
        - insights
    CreateDataMartRequestApiDto:
      type: object
      properties:
        title:
          type: string
          example: First Data Mart
        storageId:
          type: string
        icon:
          type: string
          nullable: true
          example: purchases
          description: >-
            A recommended icon key (e.g. `purchases`) or any lucide icon as
            `lucide:<icon-name>` (e.g. `lucide:shopping-cart`). Omit or null for
            the default icon.
      required:
        - title
        - storageId
    CreateDataMartResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        title:
          type: string
          example: First Data Mart
      required:
        - id
        - title
    DataMartListItemStorageApiDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - GOOGLE_BIGQUERY
            - AWS_ATHENA
            - SNOWFLAKE
            - AWS_REDSHIFT
            - DATABRICKS
            - LEGACY_GOOGLE_BIGQUERY
          example: GOOGLE_BIGQUERY
        title:
          type: string
          example: My Storage
      required:
        - type
        - title
    DataMartListItemContextApiDto:
      type: object
      properties:
        id:
          type: string
          description: Context identifier
        name:
          type: string
          description: Context display name
        icon:
          type: string
          nullable: true
          example: lucide:megaphone
          description: >-
            Context icon: A recommended icon key (e.g. `purchases`) or any
            lucide icon as `lucide:<icon-name>` (e.g. `lucide:shopping-cart`).
            null means the default icon.
      required:
        - id
        - name
        - icon
    DataMartDataLastUpdatedSummaryApiDto:
      type: object
      properties:
        dataLastUpdatedAt:
          type: string
          nullable: true
          example: '2026-07-25T08:30:00.000Z'
          description: >-
            When the newest source table last changed in the warehouse. This is
            a storage-level write time, not the period the data covers; null
            means unknown.
        computedAt:
          type: string
          example: '2026-07-28T10:00:00.000Z'
        coverage:
          type: string
          enum:
            - complete
            - partial
            - unavailable
          example: complete
      required:
        - dataLastUpdatedAt
        - computedAt
        - coverage
    DataMartListItemResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        title:
          type: string
          example: First Data Mart
        status:
          type: string
          enum:
            - DRAFT
            - PUBLISHED
          example: DRAFT
        storage:
          $ref: '#/components/schemas/DataMartListItemStorageApiDto'
        description:
          type: string
          example: Data mart description
          nullable: true
        icon:
          type: string
          nullable: true
          example: purchases
          description: >-
            User-picked icon: A recommended icon key (e.g. `purchases`) or any
            lucide icon as `lucide:<icon-name>` (e.g. `lucide:shopping-cart`).
            null means the default icon.
        definitionType:
          type: string
          enum:
            - SQL
            - TABLE
            - VIEW
            - TABLE_PATTERN
            - CONNECTOR
          example: SQL
          nullable: true
        connectorSourceName:
          type: string
          example: OpenExchangeRates
        triggersCount:
          type: integer
          example: 1
          minimum: 0
        reportsCount:
          type: integer
          example: 2
          minimum: 0
        relationshipsCount:
          type: integer
          example: 3
          minimum: 0
          description: >-
            Relationships the Data Mart defines plus the ones that point to it;
            a relationship to itself counts once. Only relationships whose other
            Data Mart the caller can see are counted.
        createdByUser:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
        businessOwnerUsers:
          type: array
          items:
            $ref: '#/components/schemas/UserProjectionDto'
        technicalOwnerUsers:
          type: array
          items:
            $ref: '#/components/schemas/UserProjectionDto'
        createdAt:
          type: string
          format: date-time
          example: '2024-01-01T12:00:00.000Z'
        modifiedAt:
          type: string
          format: date-time
          example: '2024-01-02T15:30:00.000Z'
        contexts:
          type: array
          items:
            $ref: '#/components/schemas/DataMartListItemContextApiDto'
        availableForReporting:
          type: boolean
          example: true
        availableForMaintenance:
          type: boolean
          example: true
        dataLastUpdated:
          nullable: true
          description: >-
            Last-known Data Last Updated snapshot, without per-table detail.
            Null when never computed.
          type: object
          allOf:
            - $ref: '#/components/schemas/DataMartDataLastUpdatedSummaryApiDto'
      required:
        - id
        - title
        - status
        - storage
        - description
        - icon
        - triggersCount
        - reportsCount
        - relationshipsCount
        - createdByUser
        - businessOwnerUsers
        - technicalOwnerUsers
        - createdAt
        - modifiedAt
        - contexts
        - availableForReporting
        - availableForMaintenance
        - dataLastUpdated
    PaginatedDataMartsResponseApiDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DataMartListItemResponseApiDto'
        total:
          type: integer
          example: 120
          minimum: 0
        nextOffset:
          type: integer
          example: 50
          minimum: 0
          nullable: true
          description: Next offset to fetch, null if no more data
      required:
        - items
        - total
        - nextOffset
    DataMartAiHelperAvailabilityResponseApiDto:
      type: object
      properties:
        enabled:
          type: boolean
          description: >-
            Whether AI-powered metadata generation is configured on this
            deployment. When false, frontend SHOULD hide the AI-helper buttons.
      required:
        - enabled
    DataMartImpactItemApiDto:
      type: object
      properties:
        id:
          type: string
          example: 96c33880-70e3-4151-9a07-ae379c994898
        title:
          type: string
          example: Retail orders
      required:
        - id
        - title
    DataMartInputSourceChangeImpactResponseApiDto:
      type: object
      properties:
        outboundRelationshipsCount:
          type: number
          example: 2
          description: Relationships where this DataMart joins another one
        inboundRelationshipsCount:
          type: number
          example: 3
          description: Relationships where another DataMart joins this one
        reportsCount:
          type: number
          example: 5
          description: Reports built on this DataMart
        referencingDataMartsCount:
          type: number
          example: 2
          description: >-
            SQL DataMarts whose query references this DataMart, including ones
            the caller cannot see
        referencingDataMarts:
          description: >-
            The referencing DataMarts the caller can see, by title. Fewer than
            referencingDataMartsCount when some are hidden from the caller.
          type: array
          items:
            $ref: '#/components/schemas/DataMartImpactItemApiDto'
      required:
        - outboundRelationshipsCount
        - inboundRelationshipsCount
        - reportsCount
        - referencingDataMartsCount
        - referencingDataMarts
    DataMartMemberAccessContextApiDto:
      type: object
      properties:
        id:
          type: string
          example: f1b2c3d4-0000-4000-8000-000000000001
        name:
          type: string
          example: Paid ads
      required:
        - id
        - name
    DataMartAccessLevelApiDto:
      type: object
      properties:
        granted:
          type: boolean
          example: false
        reason:
          type: string
          enum:
            - PROJECT_ADMIN
            - OWNER
            - PROJECT_WIDE_ACCESS
            - SHARED_CONTEXT
            - NOT_SHARED
            - OWNER_REQUIRED
            - ROLE_REQUIRED
            - DATA_MART_HAS_NO_CONTEXT
            - NO_SHARED_CONTEXT
          example: NO_SHARED_CONTEXT
          description: The rule that decides these actions for the member
      required:
        - granted
        - reason
    DataMartMemberAccessItemApiDto:
      type: object
      properties:
        userId:
          type: string
          example: user-123
        email:
          type: string
          example: jane@example.com
        displayName:
          type: string
          example: Jane Doe
        avatarUrl:
          type: string
          example: https://example.com/avatar.png
        role:
          type: string
          enum:
            - admin
            - editor
            - viewer
          example: viewer
        roleScope:
          type: string
          enum:
            - entire_project
            - selected_contexts
          example: selected_contexts
        contexts:
          description: >-
            The member's contexts. They limit access only when roleScope is
            selected_contexts
          type: array
          items:
            $ref: '#/components/schemas/DataMartMemberAccessContextApiDto'
        ownership:
          type: string
          enum:
            - DATA_OWNER
            - BUSINESS_OWNER
          nullable: true
          example: null
          description: >-
            The member's place in the DataMart's Ownership: Data Owner, Business
            Owner, or null
        see:
          description: >-
            See and Use: find the DataMart in the catalog and through MCP, build
            reports on it
          allOf:
            - $ref: '#/components/schemas/DataMartAccessLevelApiDto'
        edit:
          description: Edit, Delete and Manage Triggers
          allOf:
            - $ref: '#/components/schemas/DataMartAccessLevelApiDto'
        configureSharing:
          description: Configure Sharing and Manage Owners
          allOf:
            - $ref: '#/components/schemas/DataMartAccessLevelApiDto'
      required:
        - userId
        - email
        - role
        - roleScope
        - contexts
        - ownership
        - see
        - edit
        - configureSharing
    DataMartMemberAccessResponseApiDto:
      type: object
      properties:
        members:
          type: array
          items:
            $ref: '#/components/schemas/DataMartMemberAccessItemApiDto'
      required:
        - members
    UpdateDataMartDefinitionApiDto:
      type: object
      properties:
        definitionType:
          type: string
          enum:
            - SQL
            - TABLE
            - VIEW
            - TABLE_PATTERN
            - CONNECTOR
          example: SQL
        definition:
          type: object
          description: >-
            Each connector configuration item selects a Credential with
            `_credential_id` (USE on a newly selected one) and carries no key
            values.
        sourceDataMartId:
          type: string
          deprecated: true
          description: >-
            Rejected for a connector definition. Select the same Credential
            instead.
        sourceConfigurationId:
          type: string
          deprecated: true
          description: >-
            Rejected for a connector definition. Select the same Credential
            instead.
      required:
        - definitionType
        - definition
    UpdateDataMartTitleApiDto:
      type: object
      properties:
        title:
          type: string
      required:
        - title
    UpdateDataMartDescriptionApiDto:
      type: object
      properties:
        description:
          type: string
          nullable: true
    UpdateDataMartIconApiDto:
      type: object
      properties:
        icon:
          type: string
          nullable: true
          example: purchases
          description: >-
            A recommended icon key (e.g. `purchases`) or any lucide icon as
            `lucide:<icon-name>` (e.g. `lucide:shopping-cart`). null resets the
            Data Mart to the default icon.
      required:
        - icon
    UpdateDataMartOwnersApiDto:
      type: object
      properties:
        businessOwnerIds:
          type: array
          items:
            type: string
        technicalOwnerIds:
          type: array
          items:
            type: string
      required:
        - businessOwnerIds
        - technicalOwnerIds
    UpdateEntityContextsRequestApiDto:
      type: object
      properties:
        contextIds:
          type: array
          items:
            type: string
      required:
        - contextIds
    IncrementalRunDataMartPayloadApiDto:
      type: object
      properties:
        runType:
          type: string
          enum:
            - INCREMENTAL
          default: INCREMENTAL
        data:
          type: object
          additionalProperties: true
          description: >-
            Connector-specific fields retained for compatibility with existing
            run forms.
      description: Incremental connector run options.
      additionalProperties: false
    ManualBackfillRunDataMartPayloadApiDto:
      type: object
      properties:
        runType:
          type: string
          enum:
            - MANUAL_BACKFILL
        data:
          type: object
          additionalProperties: true
          description: >-
            Connector-specific manual-backfill fields, when the connector
            defines them.
      description: Manual-backfill connector run options.
      additionalProperties: false
      required:
        - runType
    RunDataMartRequestApiDto:
      type: object
      properties:
        payload:
          oneOf:
            - $ref: '#/components/schemas/IncrementalRunDataMartPayloadApiDto'
            - $ref: '#/components/schemas/ManualBackfillRunDataMartPayloadApiDto'
          example:
            runType: MANUAL_BACKFILL
            data:
              StartDate: '2026-07-01'
              EndDate: '2026-07-31'
          description: >-
            Payload for the manual run. Omit it or select INCREMENTAL for an
            incremental run.
                MANUAL_BACKFILL can include connector-specific fields in data; connectors without backfill
                fields can omit data. StartDate and EndDate accept YYYY-MM-DD (or the date part of an
                ISO-8601 timestamp). A missing or future EndDate counts as today. A StartDate earlier than
                2000-01-01 is rejected. The range has no other length limit: a range longer than 31 days runs
                as a chain of runs, one segment of up to 31 days each. A segment counts as one connector run
                once any of its accounts loads data.
    RunDataMartResponseApiDto:
      type: object
      properties:
        runId:
          type: string
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
          description: Identifier of the newly created Data Mart run.
      required:
        - runId
    DataMartValidationResponseApiDto:
      type: object
      properties:
        valid:
          type: boolean
        errorMessage:
          type: string
        reason:
          type: object
        details:
          type: object
      required:
        - valid
        - errorMessage
        - reason
        - details
    UpdateDataMartSchemaApiDto:
      type: object
      properties:
        schema:
          type: object
          description: >-
            Updated schema of the data mart. Field connection statuses are
            server-owned: omit them, and any value sent by an older client is
            ignored. The saved schema carries the last status derived by schema
            actualization; a new native field starts DISCONNECTED until schema
            actualization (POST
            /api/data-marts/{dataMartId}/schema-actualize-triggers) verifies it
            against the storage, and a formula may only reference native fields
            that are already connected.
      required:
        - schema
    FormulaViolationApiDto:
      type: object
      properties:
        code:
          type: string
          example: FORMULA_LEVEL_MIXING
          description: Machine-readable violation code
        message:
          type: string
          description: Human-readable explanation of the violation
        field:
          type: string
          description: The calculated field this violation belongs to
        subject:
          type: string
          example: clicks
          description: >-
            What inside the formula the message is about — a reference label or
            a function name — for a client that wants to point at it (an editor
            marker, a highlight). Absent when the violation is about the formula
            as a whole.
      required:
        - code
        - message
        - field
    UpdateDataMartSchemaResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        title:
          type: string
          example: First Data Mart
        status:
          type: string
          enum:
            - DRAFT
            - PUBLISHED
          example: DRAFT
        storage:
          $ref: '#/components/schemas/DataStorageResponseApiDto'
        definitionType:
          type: string
          enum:
            - SQL
            - TABLE
            - VIEW
            - TABLE_PATTERN
            - CONNECTOR
          example: SQL
        definition:
          type: object
          description: >-
            A connector configuration item bound to a Credential carries its
            `_credential_id` and no key values.
        sourceCredentials:
          description: >-
            The Credential of each bound connector configuration, as the member
            sees it. A configuration whose Credential was deleted is listed as
            restricted with state deleted, and one whose connector is no longer
            installed with state unavailable.
          type: array
          items:
            $ref: '#/components/schemas/DataMartSourceCredentialApiDto'
        description:
          type: string
        icon:
          type: string
          nullable: true
          example: purchases
          description: >-
            User-picked icon: A recommended icon key (e.g. `purchases`) or any
            lucide icon as `lucide:<icon-name>` (e.g. `lucide:shopping-cart`).
            null means the default icon.
        schema:
          type: object
        connectorState:
          $ref: '#/components/schemas/ConnectorStateResponseApiDto'
        triggersCount:
          type: number
          example: 1
        reportsCount:
          type: number
          example: 2
        createdByUser:
          type: object
        businessOwnerUsers:
          type: array
          items:
            $ref: '#/components/schemas/UserProjectionDto'
        technicalOwnerUsers:
          type: array
          items:
            $ref: '#/components/schemas/UserProjectionDto'
        blendedFieldsConfig:
          type: object
        createdAt:
          format: date-time
          type: string
          example: '2024-01-01T12:00:00.000Z'
        modifiedAt:
          format: date-time
          type: string
          example: '2024-01-02T15:30:00.000Z'
        availableForReporting:
          type: boolean
          example: true
        availableForMaintenance:
          type: boolean
          example: true
        contexts:
          type: array
          items:
            $ref: '#/components/schemas/ContextSummaryApiDto'
        dataLastUpdated:
          nullable: true
          description: >-
            Last-known Data Last Updated snapshot for this DataMart, refreshed
            on user demand. Null when never computed.
          type: object
          allOf:
            - $ref: '#/components/schemas/DataMartDataLastUpdatedResponseApiDto'
        warnings:
          description: >-
            Non-blocking calculated-field formula warnings surfaced by this
            save, e.g. an unguarded division.
          type: array
          items:
            $ref: '#/components/schemas/FormulaViolationApiDto'
      required:
        - id
        - title
        - status
        - storage
        - definitionType
        - definition
        - description
        - icon
        - schema
        - triggersCount
        - reportsCount
        - createdByUser
        - businessOwnerUsers
        - technicalOwnerUsers
        - createdAt
        - modifiedAt
        - availableForReporting
        - availableForMaintenance
        - contexts
        - dataLastUpdated
    DraftCalculatedFieldApiDto:
      type: object
      properties:
        name:
          type: string
          example: revenue
          description: The name this formula is held under.
        type:
          type: string
          example: FLOAT
          description: The field's output type.
        formula:
          type: string
          example: SUM({{ref field="amount"}})
          description: The formula in its STORED form, as the schema save would carry it.
      required:
        - name
        - type
        - formula
    ValidateFormulaApiDto:
      type: object
      properties:
        name:
          type: string
          example: ctr
          description: >-
            Name the calculated field will be saved under. A field of this name
            in the current schema is replaced by this formula for the check, so
            a reference resolves as it will at save.
        type:
          type: string
          example: FLOAT
          description: The field's output type, in the storage's own vocabulary.
        formula:
          type: string
          example: >-
            SUM({{ref field="clicks"}}) / NULLIF(SUM({{ref
            field="impressions"}}), 0)
          description: >-
            The formula in its STORED form — dialect SQL carrying {{ref}} tags,
            the same shape the schema save carries.
        calculatedFields:
          description: >-
            Every calculated field the caller's schema editor is holding, saved
            or not. The Output Schema editor defers its save, so a formula can
            name a sibling that exists nowhere on disk yet; sent here, those
            formulas REPLACE the persisted ones for this check, so a sibling
            added in the session resolves and one deleted in it stops being
            judged. Omit it (or send an empty list) and the check falls back to
            the persisted schema.
          type: array
          items:
            $ref: '#/components/schemas/DraftCalculatedFieldApiDto'
        primaryKeyFields:
          example:
            - order_id
          description: >-
            The columns the caller's schema editor marks as the primary key,
            nested ones by their dotted name. Sent, they replace the persisted
            primary-key flags for this check, so the join-grain advice matches
            what the save will say; an empty list means no primary key. Omit it
            and the check uses the persisted flags.
          type: array
          items:
            type: string
      required:
        - name
        - type
        - formula
    ValidateFormulaResponseApiDto:
      type: object
      properties:
        errors:
          description: >-
            Violations of the submitted formula itself — all of them, for this
            field only.
          type: array
          items:
            $ref: '#/components/schemas/FormulaViolationApiDto'
        warnings:
          description: >-
            Non-blocking advisories about the submitted formula, e.g. an
            unguarded division.
          type: array
          items:
            $ref: '#/components/schemas/FormulaViolationApiDto'
        otherFieldErrors:
          description: >-
            What saving this formula would break elsewhere in the schema, each
            violation named under the field that owns the broken formula — e.g.
            turning a column into a calculated field makes every other formula
            referencing that column illegal. The save refuses on these; they are
            reported here so the editor can say so before the analyst presses
            Save.
          type: array
          items:
            $ref: '#/components/schemas/FormulaViolationApiDto'
      required:
        - errors
        - warnings
        - otherFieldErrors
    BlendedFieldOverrideApiDto:
      type: object
      properties:
        alias:
          type: string
          description: Optional custom alias shown in reports for this blended field.
        isHidden:
          type: boolean
        aggregateFunction:
          type: string
          enum:
            - STRING_AGG
            - MAX
            - MIN
            - SUM
            - AVG
            - COUNT
            - COUNT_DISTINCT
            - ANY_VALUE
        postJoinAggregations:
          type: array
          items:
            type: string
            enum:
              - STRING_AGG
              - MAX
              - MIN
              - SUM
              - AVG
              - COUNT
              - COUNT_DISTINCT
              - ANY_VALUE
              - P25
              - P50
              - P75
              - P95
    BlendedSourceApiDto:
      type: object
      properties:
        path:
          type: string
          description: >-
            Dot-separated chain of target aliases identifying the blended data
            mart.
          example: orders.items
          pattern: ^[a-z0-9_]+(\.[a-z0-9_]+)*$
        alias:
          type: string
          description: Display label shown in report column headers.
          example: Orders
        isExcluded:
          type: boolean
        description:
          type: string
          description: >-
            Overrides the relationship description for this join node only. Omit
            to inherit the relationship-level description.
        fields:
          type: object
          description: >-
            Per-field overrides keyed by original field name. Values must match
            the blended field override shape.
          additionalProperties:
            $ref: '#/components/schemas/BlendedFieldOverrideApiDto'
      required:
        - path
        - alias
    BlendedFieldsConfigApiDto:
      type: object
      properties:
        sources:
          type: array
          items:
            $ref: '#/components/schemas/BlendedSourceApiDto'
      required:
        - sources
    UpdateBlendedFieldsConfigApiDto:
      type: object
      properties:
        blendedFieldsConfig:
          nullable: true
          description: Pass `null` to clear the blended fields config.
          type: object
          allOf:
            - $ref: '#/components/schemas/BlendedFieldsConfigApiDto'
    DataMartRunResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 0b0f5a1e-6f66-4a7d-8b8d-123456789abc
        status:
          example: SUCCESS
          description: Current run lifecycle status.
          allOf:
            - $ref: '#/components/schemas/DataMartRunStatus'
        type:
          example: CONNECTOR
          description: Execution category that produced the run.
          allOf:
            - $ref: '#/components/schemas/DataMartRunType'
        runType:
          example: manual
          description: Run trigger type (manual, scheduled)
          allOf:
            - $ref: '#/components/schemas/RunType'
        dataMartId:
          type: string
          example: a5c9b1d2-3456-7890-abcd-ef0123456789
        definitionRun:
          type: object
          additionalProperties: true
          example:
            connector:
              source:
                name: Example
          description: >-
            Masked definition snapshot at run time. Null when a historical
            snapshot is unavailable.
          nullable: true
        reportId:
          type: string
          example: 44c7b3e4-5d6f-7a8b-9c0d-112233445566
          nullable: true
        reportDefinition:
          type: object
          additionalProperties: true
          example:
            title: Quarterly export
            destination:
              type: GOOGLE_SHEETS
            executionSqlQuery: >-
              SELECT * FROM (SELECT * FROM `proj.ds.sales`) WHERE created_at >=
              DATE '2025-01-01'
          nullable: true
        insightId:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef0123456789
          nullable: true
        insightDefinition:
          type: object
          additionalProperties: true
          example:
            title: Analysis Q4 2025
            template: Template text with prompts
          nullable: true
        insightTemplateId:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef0123456789
          nullable: true
        insightTemplateDefinition:
          type: object
          additionalProperties: true
          example:
            title: Summary
            template: '### Summary\n{{table source="main"}}'
            sources:
              - key: main
                type: CURRENT_DATA_MART
                kind: TABLE
          nullable: true
        aiSourceDefinition:
          type: object
          additionalProperties: true
          example:
            sessionId: e7f7e087-2042-4de0-b1fc-67dddbaf88dd
            scope: template
            route: full_generation
            templateId: 6f093b03-30c1-43e0-b9ed-6d87d33edf15
            artifactId: null
            turnId: 6742f3e8-1a02-4642-bbf4-e7f8710f9507
          nullable: true
        logs:
          example:
            - '{"type":"log","at":"2025-10-09T15:13:06.930Z","message":"Started"}'
          nullable: true
          type: array
          items:
            type: string
        errors:
          example:
            - '{"type":"error","at":"2025-10-09T15:14:06.930Z","error":"Failure"}'
          nullable: true
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
          example: '2025-10-09T15:13:06.930Z'
          description: RFC3339 timestamp when the run record was created.
        startedAt:
          type: string
          format: date-time
          example: '2025-10-09T15:14:06.930Z'
          description: >-
            RFC3339 timestamp when execution started, or null when it has not
            started.
          nullable: true
        finishedAt:
          type: string
          format: date-time
          example: '2025-10-09T15:20:06.930Z'
          description: RFC3339 timestamp when execution finished, or null while unfinished.
          nullable: true
        createdByUser:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
        additionalParams:
          type: object
          additionalProperties: true
          example:
            httpData:
              format: ndjson
              columns:
                - date
              rowCount: 10
              completed: true
          description: >-
            Run-type-specific metadata captured by the use case (e.g. `httpData`
            for HTTP Data API runs)
          nullable: true
        totals:
          type: object
          additionalProperties:
            oneOf:
              - type: number
              - type: string
              - type: boolean
              - type: string
                nullable: true
                enum:
                  - null
          example:
            revenue | SUM: 1575.93
            revenue | AVG: 157.593
            country | COUNTUNIQUE: 18
          description: >-
            Grand-totals summary over the full filtered dataset (no grouping):
            every selected numeric field, plus any non-numeric field the report
            aggregates as a metric (e.g. COUNT_DISTINCT over a text column),
            each by its allowed aggregation functions. Covers native and joined
            fields. ANY_VALUE and STRING_AGG are excluded (not meaningful as a
            grand total). Null when the run produced no totals.
          nullable: true
        qualitySummary:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/CompactDataQualitySummaryApiDto'
      required:
        - id
        - status
        - type
        - runType
        - dataMartId
        - definitionRun
        - reportId
        - reportDefinition
        - insightId
        - insightDefinition
        - insightTemplateId
        - insightTemplateDefinition
        - aiSourceDefinition
        - logs
        - errors
        - createdAt
        - startedAt
        - finishedAt
        - createdByUser
        - additionalParams
        - totals
        - qualitySummary
    DataMartRunsResponseApiDto:
      type: object
      properties:
        runs:
          type: array
          items:
            $ref: '#/components/schemas/DataMartRunResponseApiDto'
      required:
        - runs
    DataQualityRelationshipSnapshotApiDto:
      type: object
      properties:
        id:
          type: string
        sourceDataMartId:
          type: string
        targetDataMartId:
          type: string
        targetAlias:
          type: string
        joinConditions:
          type: array
          items:
            $ref: '#/components/schemas/DataQualityRelationshipJoinConditionApiDto'
        targetAccessible:
          type: boolean
      required:
        - id
        - sourceDataMartId
        - targetDataMartId
        - targetAlias
        - joinConditions
    DataMartDefinitionType:
      type: string
      enum:
        - SQL
        - TABLE
        - VIEW
        - TABLE_PATTERN
        - CONNECTOR
    DataQualityRunSnapshotApiDto:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/EffectiveDataQualityConfigValueApiDto'
        schema:
          type: object
          additionalProperties: true
          nullable: true
        relationships:
          type: array
          items:
            $ref: '#/components/schemas/DataQualityRelationshipSnapshotApiDto'
        definitionType:
          allOf:
            - $ref: '#/components/schemas/DataMartDefinitionType'
      required:
        - config
        - schema
        - relationships
        - definitionType
    DataQualityResultExampleApiDto:
      type: object
      properties:
        values:
          type: object
          additionalProperties: true
      required:
        - values
    DataQualityMappedErrorApiDto:
      type: object
      properties:
        code:
          type: object
          nullable: true
        message:
          type: string
        details:
          type: object
          additionalProperties: true
          nullable: true
      required:
        - code
        - message
        - details
    DataQualityCheckResultResponseApiDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        ruleKey:
          type: string
        category:
          type: string
          enum:
            - pk_uniqueness
            - duplicate_rows
            - null_rate
            - column_uniqueness
            - constant_column
            - empty_table
            - type_mismatch
            - data_freshness
            - negative_values
            - relationship_integrity
            - reverse_relationship
        scope:
          $ref: '#/components/schemas/DataQualityScopeApiDto'
        severity:
          type: string
          enum:
            - notice
            - warning
            - error
        status:
          type: string
          enum:
            - PASSED
            - FAILED
            - NOT_APPLICABLE
            - ERROR
        violationCount:
          type: number
        description:
          type: string
        examples:
          type: array
          items:
            $ref: '#/components/schemas/DataQualityResultExampleApiDto'
        sql:
          type: object
          nullable: true
        error:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/DataQualityMappedErrorApiDto'
        createdAt:
          type: string
          format: date-time
        redacted:
          type: boolean
          description: Sensitive relationship details were hidden by target access
      required:
        - id
        - ruleKey
        - category
        - scope
        - severity
        - status
        - violationCount
        - description
        - examples
        - sql
        - error
        - createdAt
        - redacted
    DataQualityRunDetailsResponseApiDto:
      type: object
      properties:
        snapshot:
          $ref: '#/components/schemas/DataQualityRunSnapshotApiDto'
        summary:
          $ref: '#/components/schemas/DataQualitySummaryApiDto'
        results:
          type: array
          items:
            $ref: '#/components/schemas/DataQualityCheckResultResponseApiDto'
      required:
        - snapshot
        - summary
        - results
    DataMartRunDetailResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 0b0f5a1e-6f66-4a7d-8b8d-123456789abc
        status:
          example: SUCCESS
          description: Current run lifecycle status.
          allOf:
            - $ref: '#/components/schemas/DataMartRunStatus'
        type:
          example: CONNECTOR
          description: Execution category that produced the run.
          allOf:
            - $ref: '#/components/schemas/DataMartRunType'
        runType:
          example: manual
          description: Run trigger type (manual, scheduled)
          allOf:
            - $ref: '#/components/schemas/RunType'
        dataMartId:
          type: string
          example: a5c9b1d2-3456-7890-abcd-ef0123456789
        definitionRun:
          type: object
          additionalProperties: true
          example:
            connector:
              source:
                name: Example
          description: >-
            Masked definition snapshot at run time. Null when a historical
            snapshot is unavailable.
          nullable: true
        reportId:
          type: string
          example: 44c7b3e4-5d6f-7a8b-9c0d-112233445566
          nullable: true
        reportDefinition:
          type: object
          additionalProperties: true
          example:
            title: Quarterly export
            destination:
              type: GOOGLE_SHEETS
            executionSqlQuery: >-
              SELECT * FROM (SELECT * FROM `proj.ds.sales`) WHERE created_at >=
              DATE '2025-01-01'
          nullable: true
        insightId:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef0123456789
          nullable: true
        insightDefinition:
          type: object
          additionalProperties: true
          example:
            title: Analysis Q4 2025
            template: Template text with prompts
          nullable: true
        insightTemplateId:
          type: string
          example: a1b2c3d4-e5f6-7890-abcd-ef0123456789
          nullable: true
        insightTemplateDefinition:
          type: object
          additionalProperties: true
          example:
            title: Summary
            template: '### Summary\n{{table source="main"}}'
            sources:
              - key: main
                type: CURRENT_DATA_MART
                kind: TABLE
          nullable: true
        aiSourceDefinition:
          type: object
          additionalProperties: true
          example:
            sessionId: e7f7e087-2042-4de0-b1fc-67dddbaf88dd
            scope: template
            route: full_generation
            templateId: 6f093b03-30c1-43e0-b9ed-6d87d33edf15
            artifactId: null
            turnId: 6742f3e8-1a02-4642-bbf4-e7f8710f9507
          nullable: true
        logs:
          example:
            - '{"type":"log","at":"2025-10-09T15:13:06.930Z","message":"Started"}'
          nullable: true
          type: array
          items:
            type: string
        errors:
          example:
            - '{"type":"error","at":"2025-10-09T15:14:06.930Z","error":"Failure"}'
          nullable: true
          type: array
          items:
            type: string
        createdAt:
          type: string
          format: date-time
          example: '2025-10-09T15:13:06.930Z'
          description: RFC3339 timestamp when the run record was created.
        startedAt:
          type: string
          format: date-time
          example: '2025-10-09T15:14:06.930Z'
          description: >-
            RFC3339 timestamp when execution started, or null when it has not
            started.
          nullable: true
        finishedAt:
          type: string
          format: date-time
          example: '2025-10-09T15:20:06.930Z'
          description: RFC3339 timestamp when execution finished, or null while unfinished.
          nullable: true
        createdByUser:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
        additionalParams:
          type: object
          additionalProperties: true
          example:
            httpData:
              format: ndjson
              columns:
                - date
              rowCount: 10
              completed: true
          description: >-
            Run-type-specific metadata captured by the use case (e.g. `httpData`
            for HTTP Data API runs)
          nullable: true
        totals:
          type: object
          additionalProperties:
            oneOf:
              - type: number
              - type: string
              - type: boolean
              - type: string
                nullable: true
                enum:
                  - null
          example:
            revenue | SUM: 1575.93
            revenue | AVG: 157.593
            country | COUNTUNIQUE: 18
          description: >-
            Grand-totals summary over the full filtered dataset (no grouping):
            every selected numeric field, plus any non-numeric field the report
            aggregates as a metric (e.g. COUNT_DISTINCT over a text column),
            each by its allowed aggregation functions. Covers native and joined
            fields. ANY_VALUE and STRING_AGG are excluded (not meaningful as a
            grand total). Null when the run produced no totals.
          nullable: true
        qualitySummary:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/CompactDataQualitySummaryApiDto'
        dataQuality:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/DataQualityRunDetailsResponseApiDto'
      required:
        - id
        - status
        - type
        - runType
        - dataMartId
        - definitionRun
        - reportId
        - reportDefinition
        - insightId
        - insightDefinition
        - insightTemplateId
        - insightTemplateDefinition
        - aiSourceDefinition
        - logs
        - errors
        - createdAt
        - startedAt
        - finishedAt
        - createdByUser
        - additionalParams
        - totals
        - qualitySummary
        - dataQuality
    RefreshDataMartDataLastUpdatedRequestApiDto:
      type: object
      properties:
        ids:
          description: >-
            Data Marts to measure. All are looked up together, so ids sharing a
            storage pay for that storage’s warehouse client only once.
          type: array
          items:
            type: string
      required:
        - ids
    DataMartDataLastUpdatedItemApiDto:
      type: object
      properties:
        dataMartId:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        dataLastUpdated:
          $ref: '#/components/schemas/DataMartDataLastUpdatedResponseApiDto'
      required:
        - dataMartId
        - dataLastUpdated
    BatchDataMartDataLastUpdatedResponseApiDto:
      type: object
      properties:
        items:
          description: >-
            One entry per Data Mart that was measured. Requested ids may be
            absent when the lookup was cut short or the Data Mart is not visible
            — treat a missing id as "no new information", not as a reset.
          type: array
          items:
            $ref: '#/components/schemas/DataMartDataLastUpdatedItemApiDto'
      required:
        - items
    BatchDataMartHealthStatusRequestApiDto:
      type: object
      properties:
        ids:
          type: array
          items:
            type: string
      required:
        - ids
    BatchDataMartHealthStatusItemApiDto:
      type: object
      properties:
        dataMartId:
          type: string
        connector:
          type: object
          nullable: true
        report:
          type: object
          nullable: true
        insight:
          type: object
          nullable: true
      required:
        - dataMartId
    BatchDataMartHealthStatusResponseApiDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/BatchDataMartHealthStatusItemApiDto'
      required:
        - items
    UpdateDataMartAvailabilityApiDto:
      type: object
      properties:
        availableForReporting:
          type: boolean
          description: Whether the DataMart is available for reporting
          example: true
        availableForMaintenance:
          type: boolean
          description: Whether the DataMart is available for maintenance
          example: false
      required:
        - availableForReporting
        - availableForMaintenance
    BlendedFieldDto:
      type: object
      properties:
        name:
          type: string
          description: >-
            SQL-safe unified name for this blended field, used in report configs
            (columns, filters, sort, aggregations). Derived from (aliasPath,
            originalFieldName).
        sourceRelationshipId:
          type: string
          description: ID of the Data Mart relationship this field was pulled through.
        sourceDataMartId:
          type: string
          description: ID of the joined Data Mart this field originates from.
        sourceDataMartTitle:
          type: string
          description: Title of the joined Data Mart this field originates from.
        targetAlias:
          type: string
          description: >-
            SQL-safe alias segment for the relationship (matches ^[a-z0-9_]+$),
            used to build aliasPath.
        originalFieldName:
          type: string
          description: >-
            The field's name as declared in the source Data Mart's schema,
            before qualification.
        type:
          type: string
          description: >-
            Effective output type of this field in the blended result — the type
            AFTER the dedup aggregate function (aggregateFunction) is applied,
            not necessarily the raw source type.
        sourceFieldType:
          type: string
          description: >-
            The raw source-field type, before the dedup effective-type
            resolution overwrites `type`. Needed to recompute effective types
            for type-preserving dedups.
        alias:
          type: string
          description: >-
            Analyst-configured display alias for this field; empty string when
            unset.
        description:
          type: string
          description: >-
            Field description inherited from the source Data Mart's schema;
            empty string when none is set.
        isHidden:
          type: boolean
          description: >-
            Whether this field is hidden from the reporting column picker by
            analyst configuration.
        isCalculated:
          type: boolean
          description: >-
            Whether this field is a CALCULATED field of the joined Data Mart — a
            formula, with no column behind it in the warehouse. It is still
            listed, because a client that only saw it disappear could not
            explain why: both consumers of this payload need to tell "not there"
            apart from "there, but not usable from here". A formula on the main
            Data Mart cannot reference one: a formula may read another formula
            of its OWN Data Mart, but not one of a joined Data Mart, because
            this payload carries no formula to substitute and the joined source
            would not be access-checked. It cannot be selected as an ordinary
            report column either — the blended path projects a real source
            column for each.
        aggregateFunction:
          type: string
          enum:
            - STRING_AGG
            - MAX
            - MIN
            - SUM
            - AVG
            - COUNT
            - COUNT_DISTINCT
            - ANY_VALUE
          description: >-
            Dedup (pre-join) aggregate function that collapses this source's
            rows to one value per join key before the join runs.
        postJoinAggregations:
          type: array
          description: >-
            Aggregations the report level may apply to this field after the
            join. An explicit empty array means none are allowed; absent falls
            back to the effective type's default aggregations.
          items:
            type: string
            enum:
              - STRING_AGG
              - MAX
              - MIN
              - SUM
              - AVG
              - COUNT
              - COUNT_DISTINCT
              - ANY_VALUE
              - P25
              - P50
              - P75
              - P95
        transitiveDepth:
          type: number
          description: >-
            Number of join hops between the main Data Mart and this field's
            source.
        aliasPath:
          type: string
          description: >-
            SQL-safe dotted path of relationship aliases identifying this
            field's source in the join tree (e.g. `orders.items`). Each segment
            matches ^[a-z0-9_]+$.
        outputPrefix:
          type: string
          description: >-
            Human display prefix for this field's source, shown in the reporting
            column picker. Free-form text — must never be used to build a SQL
            identifier.
      required:
        - name
        - sourceRelationshipId
        - sourceDataMartId
        - sourceDataMartTitle
        - targetAlias
        - originalFieldName
        - type
        - sourceFieldType
        - alias
        - description
        - isHidden
        - isCalculated
        - aggregateFunction
        - transitiveDepth
        - aliasPath
        - outputPrefix
    AvailableSourceDto:
      type: object
      properties:
        aliasPath:
          type: string
          description: >-
            SQL-safe dotted path of relationship aliases identifying this source
            in the join tree. Uniquely identifies the source among
            availableSources.
        title:
          type: string
          description: Title of the joined Data Mart.
        description:
          type: string
          description: Description of the joined Data Mart, if set.
        joinDescription:
          type: string
          description: >-
            Effective analyst-written business description of THIS join node:
            the per-join override when set, otherwise the relationship-level
            description. Distinct from `description`, which is the joined Data
            Mart's own description.
        defaultAlias:
          type: string
          description: >-
            Human display prefix for this source, shown in the reporting column
            picker. Free-form text, configurable per relationship — must never
            be used to build a SQL identifier or output column name.
        depth:
          type: number
          description: Number of join hops between the main Data Mart and this source.
        fieldCount:
          type: number
          description: >-
            Number of fields this source contributes to blendedFields. Depending
            on the request options, this may include disconnected fields.
        isIncluded:
          type: boolean
          description: >-
            Whether this source is included in reporting. An excluded source
            still appears here so a client can render and clear an existing
            selection.
        relationshipId:
          type: string
          description: ID of the Data Mart relationship that exposes this source.
        dataMartId:
          type: string
          description: ID of the joined Data Mart.
        isAccessibleForReporting:
          type: boolean
          description: >-
            Whether the current user may read this Data Mart for reporting.
            Distinct from isIncluded: a source can be included but inaccessible
            to this user, or accessible but excluded.
        uniqueCountAvailability:
          type: string
          enum:
            - available
            - no-primary-key
            - disconnected-primary-key
            - nested-primary-key
            - nested-and-disconnected-primary-key
          description: >-
            Whether this joined Data Mart can offer a Unique Count metric.
            `available` means its primary key is usable to count distinct rows;
            the other values diagnose why it cannot, so a client can show the
            right explanation instead of hiding the option: `no-primary-key` —
            no Primary Key is set on the Data Mart; `disconnected-primary-key` —
            a Primary Key is declared but disconnected, so it cannot key the
            join; `nested-primary-key` — the Primary Key is a nested field,
            which Unique Count doesn't support;
            `nested-and-disconnected-primary-key` — both at once, so fixing only
            one of them still leaves the metric unavailable.
        uniqueCountKeyFields:
          description: >-
            The primary-key columns this source's Unique Count counts by — every
            component of the key, in schema order, so a client can name them in
            an explanation of the metric. Exactly the columns the query counts
            by, including one hidden from reporting (hidden means off the
            reporting menu, not absent from the source). Empty whenever
            `uniqueCountAvailability` is not `available`: there is then no key
            the metric could use.
          type: array
          items:
            type: string
        mainGrainMultiplication:
          type: string
          enum:
            - none
            - multiplies
            - unknown
          description: >-
            Whether this source's rows are multiplied when attached to the main
            Data Mart — the join key is not proven unique on its parent, so one
            joined value can land on several main rows. A fact about ROWS: what
            each aggregate makes of it differs per aggregate. `none` — every hop
            from the main Data Mart down to this source is keyed by its parent's
            primary key, so nothing is multiplied. `multiplies` — at least one
            hop is keyed by something that does not cover its parent's primary
            key. `unknown` — some parent on the chain declares no primary key,
            so uniqueness is undecidable in either direction. A client that does
            not know this property must read its absence as `unknown`, never as
            `none`: the fallback has to be the one that still warns.
        mainGrainKeyFields:
          description: >-
            The join-key columns of the hop that multiplies, named on that hop's
            parent, so a message can tell an analyst which key is at fault.
            Empty whenever mainGrainMultiplication is not `multiplies`.
          type: array
          items:
            type: string
        mainGrainUnprovenAt:
          type: string
          description: >-
            The aliasPath of the Data Mart that declares no primary key, so a
            message can name the one that needs it. An empty string means the
            main Data Mart itself. Present only when mainGrainMultiplication is
            `unknown`.
        mainGrainMultipliedAt:
          type: string
          description: >-
            The aliasPath of the hop that multiplies, which is NOT always this
            source: a verdict is inherited down the chain together with the
            failing hop's key, so mainGrainKeyFields can belong to an ancestor.
            A message that names this source as the one joined on that key sends
            an analyst to edit the wrong relationship. Present only when
            mainGrainMultiplication is `multiplies`.
        mainGrainCollapse:
          type: string
          enum:
            - none
            - collapses
          description: >-
            The other side of the same joins: whether several rows of a joined
            Data Mart can share one join-key value and so collapse into a single
            match. A joined Data Mart is attached to the main one collapsed to
            one row per key, so an aggregate read off that collapsed row — a
            non-DISTINCT `COUNT` — counts main rows, and comes out lower than
            the joined rows. `none` — every hop from the main Data Mart down to
            this source is keyed by its target's primary key. `collapses` — at
            least one is not, or its target declares no primary key. A client
            that does not know this property must read its absence as
            `collapses`.
        mainGrainCollapsedAt:
          type: string
          description: >-
            The aliasPath of the hop whose target rows collapse — the one
            closest to the main Data Mart, which is not always this source.
            Present only when mainGrainCollapse is `collapses`.
      required:
        - aliasPath
        - title
        - defaultAlias
        - depth
        - fieldCount
        - isIncluded
        - relationshipId
        - dataMartId
        - isAccessibleForReporting
        - uniqueCountAvailability
        - uniqueCountKeyFields
        - mainGrainMultiplication
        - mainGrainKeyFields
        - mainGrainCollapse
    CalculatedFieldIssueDto:
      type: object
      properties:
        field:
          type: string
          description: Name of the calculated field with a broken formula reference.
        missing:
          description: >-
            Names this field's formula references that no longer resolve against
            the Data Mart's schema — the same names
            `CALCULATED_FIELD_BROKEN_REFERENCES` reports at query composition
            time. Never empty when this entry is present.
          type: array
          items:
            type: string
      required:
        - field
        - missing
    BlendableSchemaDto:
      type: object
      properties:
        nativeFields:
          type: array
          items:
            type: object
          description: >-
            The main Data Mart's own fields (native, unblended), filtered to
            reporting-visible ones. Shape follows the storage-specific Data Mart
            schema field contract (see `DataMartSchema` in
            data-storage-types/data-mart-schema.type.ts) — a recursive
            per-storage-type field tree, not modeled field-by-field here.
        nativeDescription:
          type: string
          description: Description of the main Data Mart, if set.
        blendedFields:
          description: Fields pulled in from joined Data Marts reachable via relationships.
          type: array
          items:
            $ref: '#/components/schemas/BlendedFieldDto'
        availableSources:
          description: >-
            Joined Data Marts reachable via relationships, each describing its
            inclusion, access, and Unique-Count status.
          type: array
          items:
            $ref: '#/components/schemas/AvailableSourceDto'
        mainUniqueCountKeyFields:
          description: >-
            The main Data Mart's primary-key columns its Unique Count counts by,
            in schema order; empty when the metric is unavailable. Cannot be
            derived from `nativeFields`: a key column hidden for reporting is
            absent from that list but still counted, since counting does not
            project it.
          type: array
          items:
            type: string
        calculatedFieldIssues:
          description: >-
            Every calculated field of the main Data Mart whose formula
            references a field the schema no longer has — resolved against the
            RAW schema (like `mainUniqueCountKeyFields` above), never
            `nativeFields`: a formula may legally reference a field hidden for
            reporting, and that list has already had those stripped. A field
            with no issue is simply absent here.
          type: array
          items:
            $ref: '#/components/schemas/CalculatedFieldIssueDto'
        hiddenFieldNames:
          description: >-
            Column names someone hid from reporting, in the form a report stores
            them: own columns as dotted paths (`metrics.cost`, a hidden RECORD
            bringing its subtree), joined columns by their unified blended name
            — the same form as `blendedFields[].name`, hash suffix and all.
            Covers both joined switches: a field hidden on the joined Data Mart
            (absent from `blendedFields` entirely) and one hidden per join
            (present there with `isHidden: true`). The list exists so a report
            that still selects such a column can be told it was HIDDEN rather
            than lost, which is a different fact with a different fix. A column
            that is also disconnected is left out: it really is gone.
          type: array
          items:
            type: string
      required:
        - nativeFields
        - blendedFields
        - availableSources
        - mainUniqueCountKeyFields
        - calculatedFieldIssues
        - hiddenFieldNames
    ConnectorTargetConflictDataMartApiDto:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
      required:
        - id
        - title
    ConnectorTargetConflictResponseApiDto:
      type: object
      properties:
        conflict:
          type: boolean
        dataMart:
          nullable: true
          description: >-
            The other Data Mart, or null when none exists or the caller cannot
            see it
          type: object
          allOf:
            - $ref: '#/components/schemas/ConnectorTargetConflictDataMartApiDto'
      required:
        - conflict
        - dataMart
    DataStorageListResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: abc123e4-5678-90ab-cdef-1234567890ab
        title:
          type: string
          example: title
        type:
          type: string
          enum:
            - GOOGLE_BIGQUERY
            - AWS_ATHENA
            - SNOWFLAKE
            - AWS_REDSHIFT
            - DATABRICKS
            - LEGACY_GOOGLE_BIGQUERY
          example: GOOGLE_BIGQUERY
        createdAt:
          format: date-time
          type: string
          example: '2024-01-01T12:00:00.000Z'
        modifiedAt:
          format: date-time
          type: string
          example: '2024-01-02T15:30:00.000Z'
        publishedDataMartsCount:
          type: number
          example: 0
        draftDataMartsCount:
          type: number
          example: 0
        createdByUser:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
        ownerUsers:
          type: array
          items:
            $ref: '#/components/schemas/UserProjectionDto'
        contexts:
          type: array
          items:
            $ref: '#/components/schemas/ContextSummaryApiDto'
        availableForUse:
          type: boolean
          example: true
        availableForMaintenance:
          type: boolean
          example: true
        reusableCredential:
          nullable: true
          description: >-
            The Credential the Storage uses, as the member sees it; pending
            while the Storage runs on its own key; null when it has neither
          type: object
          allOf:
            - $ref: '#/components/schemas/StorageCredentialSummaryApiDto'
      required:
        - id
        - title
        - type
        - createdAt
        - modifiedAt
        - publishedDataMartsCount
        - draftDataMartsCount
        - ownerUsers
        - contexts
        - availableForUse
        - availableForMaintenance
        - reusableCredential
    UpdateDataStorageApiDto:
      type: object
      properties:
        title:
          type: string
          description: Custom title for the data storage
          maxLength: 255
        reusableCredentialId:
          type: string
          description: >-
            Credential to use for this Storage. Absent keeps the current one;
            null is rejected. Needs EDIT on the Storage and USE on the
            Credential.
        credentials:
          type: object
          additionalProperties: true
          deprecated: true
          description: Rejected. Select a Credential with reusableCredentialId.
        config:
          type: object
          additionalProperties: true
          description: Configuration specific to the storage type
        credentialId:
          type: string
          nullable: true
          deprecated: true
          description: Rejected. Select a Credential with reusableCredentialId.
        sourceStorageId:
          type: string
          deprecated: true
          description: Rejected. Select a Credential with reusableCredentialId.
        ownerIds:
          type: array
          items:
            type: string
        availableForUse:
          type: boolean
          description: Whether this storage is available for use by project members
        availableForMaintenance:
          type: boolean
          description: Whether this storage is available for maintenance by project members
        contextIds:
          description: Context IDs attached to this storage (full replacement)
          type: array
          items:
            type: string
      required:
        - title
        - config
    CreateDataStorageApiDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - GOOGLE_BIGQUERY
            - AWS_ATHENA
            - SNOWFLAKE
            - AWS_REDSHIFT
            - DATABRICKS
            - LEGACY_GOOGLE_BIGQUERY
        ownerIds:
          type: array
          items:
            type: string
      required:
        - type
    DataStorageByTypeResponseApiDto:
      type: object
      properties:
        id:
          type: string
          description: Data Storage ID
        title:
          type: string
          description: Data Storage title
        dataMartName:
          type: string
          description: Name of the Data Mart that uses this storage (null if none)
          nullable: true
        identity:
          type: object
          description: Credential identity (display info, no secrets)
          additionalProperties: true
          nullable: true
      required:
        - id
        - title
        - dataMartName
        - identity
    StorageNamespaceNodeDto:
      type: object
      properties:
        id:
          type: string
          description: Namespace identifier (e.g. GCP project ID, Snowflake database name)
          example: my-gcp-project
        label:
          type: string
          description: Human-friendly name when different from id
          example: My GCP Project
      required:
        - id
    StorageResourceLeafDto:
      type: object
      properties:
        id:
          type: string
          description: Resource identifier (table or view name)
          example: orders
        groupId:
          type: string
          description: Parent group identifier (dataset, schema, …)
          example: analytics_prod
        type:
          type: string
          description: Resource type
          enum:
            - TABLE
            - VIEW
        fullyQualifiedName:
          type: string
          description: Fully qualified name ready to use in a Data Mart definition
          example: my-gcp-project.analytics_prod.orders
        location:
          type: string
          description: Where the resource's data lives, e.g. a BigQuery dataset location
          example: EU
        locationMismatch:
          type: boolean
          description: >-
            True when the resource lives in a different location than the one
            the storage runs queries in, so a data mart on this storage cannot
            read it. Omitted when either location is unknown.
      required:
        - id
        - groupId
        - type
        - fullyQualifiedName
    ListStorageResourcesResponseDto:
      type: object
      properties:
        namespaces:
          type: array
          items:
            $ref: '#/components/schemas/StorageNamespaceNodeDto'
        resources:
          type: array
          items:
            $ref: '#/components/schemas/StorageResourceLeafDto'
    DataStorageAccessValidationResponseApiDto:
      type: object
      properties:
        valid:
          type: boolean
        errorMessage:
          type: string
        code:
          type: string
          enum:
            - UNCONFIGURED
            - OAUTH_REAUTH_REQUIRED
          description: Machine-readable validation result code
      required:
        - valid
        - errorMessage
    UpdateStorageAvailabilityApiDto:
      type: object
      properties:
        availableForUse:
          type: boolean
          description: Whether the Data Storage is available for use
          example: true
        availableForMaintenance:
          type: boolean
          description: Whether the Data Storage is available for maintenance
          example: false
      required:
        - availableForUse
        - availableForMaintenance
    DestinationConfigDto:
      type: object
      properties:
        folderUrl:
          type: object
          nullable: true
          description: >-
            Google Drive folder URL for auto-created Google Sheets (Google
            Sheets destinations). The folder ID is derived from it server-side.
            Pass null/empty to clear.
    CreateDataDestinationApiDto:
      type: object
      properties:
        title:
          type: string
          example: My Google Sheets Destination
        type:
          type: string
          enum:
            - GOOGLE_SHEETS
            - LOOKER_STUDIO
            - EXCEL
            - EMAIL
            - SLACK
            - MS_TEAMS
            - GOOGLE_CHAT
        credentials:
          type: object
          additionalProperties: true
          description: >-
            Credentials for Data Studio, Email, Slack and Microsoft Teams, and
            the email recipients of a Google Chat Destination. Google Sheets and
            Google Chat webhook delivery select a Credential with
            reusableCredentialId instead.
        reusableCredentialId:
          type: string
          description: >-
            Credential for a Google Sheets Destination, or a Google Chat
            Destination that delivers by webhook. Required for Google Sheets;
            Google Chat needs it or email credentials; null is rejected. Needs
            USE on the Credential.
        credentialId:
          type: string
          nullable: true
          deprecated: true
          description: 'Rejected: "This page is out of date. Reload it."'
        sourceDestinationId:
          type: string
          deprecated: true
          description: 'Rejected: "This page is out of date. Reload it."'
        ownerIds:
          type: array
          items:
            type: string
        config:
          description: >-
            Optional destination-level config (e.g. Google Drive folder for
            Google Sheets)
          allOf:
            - $ref: '#/components/schemas/DestinationConfigDto'
      required:
        - title
        - type
    CreateConnectGoogleSheetsDestinationApiDto:
      type: object
      properties:
        title:
          type: string
          example: Google Sheets (user@example.com)
        reusableCredentialId:
          type: string
          description: >-
            Credential the Destination uses: one that fits Google Sheets and the
            member can USE
        credentialId:
          type: string
          deprecated: true
          description: 'Rejected: "This page is out of date. Reload it."'
      required:
        - title
        - reusableCredentialId
    DataDestinationByTypeResponseApiDto:
      type: object
      properties:
        id:
          type: string
          description: Data Destination ID
        title:
          type: string
          description: Data Destination title
        dataMartName:
          type: string
          description: Name of the Data Mart that uses this destination (null if none)
          nullable: true
        identity:
          type: object
          description: Credential identity (display info, no secrets)
          additionalProperties: true
          nullable: true
      required:
        - id
        - title
        - dataMartName
        - identity
    UpdateDataDestinationApiDto:
      type: object
      properties:
        title:
          type: string
          example: My Updated Google Sheets Destination
        credentials:
          type: object
          additionalProperties: true
          description: >-
            Credentials for Data Studio, Email, Slack and Microsoft Teams, and
            the email recipients of a Google Chat Destination. Google Sheets and
            Google Chat webhook delivery select a Credential with
            reusableCredentialId instead.
        reusableCredentialId:
          type: string
          description: >-
            Credential for a Google Sheets Destination, or a Google Chat
            Destination that delivers by webhook. Absent keeps the current one;
            null is rejected. Needs USE on the Credential and EDIT on the
            Destination.
        credentialId:
          type: string
          nullable: true
          deprecated: true
          description: 'Rejected: "This page is out of date. Reload it."'
        sourceDestinationId:
          type: string
          deprecated: true
          description: 'Rejected: "This page is out of date. Reload it."'
        ownerIds:
          type: array
          items:
            type: string
        availableForUse:
          type: boolean
          description: Whether this destination is available for use by project members
        availableForMaintenance:
          type: boolean
          description: >-
            Whether this destination is available for maintenance by project
            members
        contextIds:
          description: Context IDs attached to this destination (full replacement)
          type: array
          items:
            type: string
        config:
          description: >-
            Optional destination-level config (e.g. Google Drive folder for
            Google Sheets)
          allOf:
            - $ref: '#/components/schemas/DestinationConfigDto'
      required:
        - title
    GoogleOAuthSettingsResponseDto:
      type: object
      properties:
        available:
          type: boolean
          example: true
          description: Whether OAuth is configured for this resource type
        authorizationEndpoint:
          type: string
          example: https://accounts.google.com/o/oauth2/v2/auth
          description: Google OAuth authorization endpoint
        clientId:
          type: string
          example: 123456789-abcdefghijklmnop.apps.googleusercontent.com
          description: OAuth client ID (public, safe to expose to frontend)
        redirectUri:
          type: string
          example: https://app.owox.com/api/google-oauth/callback
          description: OAuth redirect URI configured in Google Console
        availableScopes:
          example:
            - https://www.googleapis.com/auth/bigquery
          description: Available OAuth scopes for this resource type
          type: array
          items:
            type: string
        pickerApiKey:
          type: string
          example: AIzaSy...
          description: >-
            Google API key for the Drive Picker (destination only; public, safe
            to expose)
      required:
        - available
    DataDestinationImpactResponseApiDto:
      type: object
      properties:
        destinationId:
          type: string
          example: abc123e4-5678-90ab-cdef-1234567890ab
        destinationTitle:
          type: string
          example: My Google Sheets Destination
        reportsCount:
          type: number
          example: 5
          description: Total number of reports referencing this destination.
        dataMartCount:
          type: number
          example: 3
          description: >-
            Number of distinct data marts whose reports reference this
            destination.
      required:
        - destinationId
        - destinationTitle
        - reportsCount
        - dataMartCount
    UpdateDestinationAvailabilityApiDto:
      type: object
      properties:
        availableForUse:
          type: boolean
          description: Whether the Data Destination is available for use
          example: true
        availableForMaintenance:
          type: boolean
          description: Whether the Data Destination is available for maintenance
          example: false
      required:
        - availableForUse
        - availableForMaintenance
    CreateGoogleSheetDocumentRequestDto:
      type: object
      properties:
        title:
          type: string
          example: Revenue by channel
          description: >-
            Title for the new Google Sheet. Falls back to a default when
            omitted.
    CreateGoogleSheetDocumentResponseDto:
      type: object
      properties:
        spreadsheetId:
          type: string
          example: 1AbCdEfGhIjKlMnOpQrStUvWxYz
          description: ID of the newly created Google Spreadsheet
        sheetId:
          type: number
          example: 0
          description: Numeric ID (gid) of the first sheet in the new spreadsheet
        placedInRoot:
          type: boolean
          example: false
          description: >-
            True when a Drive folder was configured but the document was created
            in the Drive root instead (the connected OAuth token lacks a Drive
            scope). The user should reconnect the Google account to honor the
            chosen folder.
        sharedWithRequester:
          type: boolean
          example: true
          description: >-
            Whether the document was shared with the requesting user. False when
            sharing was skipped (token lacks a Drive scope, or the requester
            email could not be resolved) or failed.
      required:
        - spreadsheetId
        - sheetId
    ReportAggregationRuleApiDto:
      type: object
      properties:
        column:
          type: string
          minLength: 1
          description: Output column name to aggregate.
        function:
          type: string
          enum:
            - STRING_AGG
            - MAX
            - MIN
            - SUM
            - AVG
            - COUNT
            - COUNT_DISTINCT
            - ANY_VALUE
            - P25
            - P50
            - P75
            - P95
          description: Aggregation function to apply to the column.
      required:
        - column
        - function
    ReportDateTruncRuleApiDto:
      type: object
      properties:
        column:
          type: string
          minLength: 1
          description: Date/timestamp dimension column to truncate.
        unit:
          type: string
          enum:
            - DAY
            - WEEK
            - MONTH
            - QUARTER
            - YEAR
          description: Calendar bucket to truncate the column to.
        timeZone:
          type: string
          description: >-
            Optional IANA time zone (e.g. America/New_York). When set, the value
            is converted to this zone before truncation; absent = no conversion.
      required:
        - column
        - unit
    ReportBetweenFilterValueApiDto:
      type: object
      properties:
        from:
          oneOf:
            - type: string
            - type: number
            - type: boolean
        to:
          oneOf:
            - type: string
            - type: number
            - type: boolean
      required:
        - from
        - to
    ReportCustomMessageTemplateSourceApiDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - CUSTOM_MESSAGE
        config:
          type: object
          required:
            - messageTemplate
          properties:
            messageTemplate:
              type: string
              minLength: 1
      required:
        - type
    ReportEmailDestinationConfigApiDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - email-config
        subject:
          type: string
          minLength: 1
        templateSource:
          oneOf:
            - $ref: '#/components/schemas/ReportCustomMessageTemplateSourceApiDto'
            - $ref: '#/components/schemas/ReportInsightTemplateSourceApiDto'
        reportCondition:
          type: string
          enum:
            - ALWAYS
            - RESULT_IS_EMPTY
            - RESULT_IS_NOT_EMPTY
      required:
        - type
        - subject
        - templateSource
        - reportCondition
    ReportFilterRuleApiDto:
      type: object
      properties:
        column:
          type: string
          minLength: 1
          description: >-
            Output column name. For slice filters (placement=pre-join), use the
            fully qualified blended column identifier from the blendable schema
            (flat: category_details__item_count; nested fields include a hash
            suffix).
        operator:
          type: string
          enum:
            - eq
            - neq
            - contains
            - not_contains
            - starts_with
            - ends_with
            - gt
            - lt
            - gte
            - lte
            - regex
            - not_regex
            - is_blank
            - is_not_blank
            - is_empty
            - is_not_empty
            - is_null
            - is_not_null
            - is_true
            - is_false
            - between
            - relative_date
        value:
          description: >-
            Required for scalar, between, and relative_date operators. Omit for
            is_blank/is_true-style operators.
          oneOf:
            - oneOf:
                - type: string
                - type: number
                - type: boolean
            - $ref: '#/components/schemas/ReportBetweenFilterValueApiDto'
            - $ref: '#/components/schemas/ReportRelativeDateFilterValueApiDto'
        placement:
          type: string
          enum:
            - pre-join
            - post-join
          description: Use pre-join for slice filters. Omit for normal output filters.
        function:
          type: string
          enum:
            - STRING_AGG
            - MAX
            - MIN
            - SUM
            - AVG
            - COUNT
            - COUNT_DISTINCT
            - ANY_VALUE
            - P25
            - P50
            - P75
            - P95
          description: >-
            When set, the rule filters the AGGREGATED value of the column after
            grouping (HAVING <function>(column) <operator> <value>) instead of
            the raw rows (WHERE). The (column, function) pair must match a
            configured aggregationConfig entry.
      required:
        - column
        - operator
    ReportGoogleSheetsDestinationConfigApiDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - google-sheets-config
        spreadsheetId:
          type: string
          minLength: 1
        sheetId:
          type: number
          minimum: 0
      required:
        - type
        - spreadsheetId
        - sheetId
    ReportInsightTemplateSourceApiDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - INSIGHT_TEMPLATE
        config:
          type: object
          required:
            - insightTemplateId
          properties:
            insightTemplateId:
              type: string
              minLength: 1
      required:
        - type
    ReportLegacyEmailDestinationConfigApiDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - email-config
        subject:
          type: string
          minLength: 1
        messageTemplate:
          type: string
          minLength: 1
        reportCondition:
          type: string
          enum:
            - ALWAYS
            - RESULT_IS_EMPTY
            - RESULT_IS_NOT_EMPTY
      required:
        - type
        - subject
        - messageTemplate
        - reportCondition
    ReportLookerStudioDestinationConfigApiDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - looker-studio-config
        cacheLifetime:
          type: number
          minimum: 60
      required:
        - type
        - cacheLifetime
    ReportRelativeDateFilterValueApiDto:
      type: object
      properties:
        kind:
          type: string
          enum:
            - today
            - yesterday
            - this_month
            - last_month
            - this_year
            - last_n_days
            - last_n_months
        'n':
          type: number
          description: Required when kind is last_n_days or last_n_months.
          minimum: 1
          maximum: 3650
      required:
        - kind
    ReportSortRuleApiDto:
      type: object
      properties:
        column:
          type: string
          minLength: 1
          description: Output column name to sort by.
          example: date
        direction:
          type: string
          enum:
            - asc
            - desc
          description: Sort direction for this column.
      required:
        - column
        - direction
    ReconnectGoogleSheetResponseDto:
      type: object
      properties:
        spreadsheetId:
          type: string
          example: 1AbCdEfGhIjKlMnOpQrStUvWxYz
          description: ID of the spreadsheet the report writes to (unchanged by this call)
        sheetId:
          type: number
          example: 182736451
          description: Numeric ID (gid) of the sheet the report is now connected to
        sheetTitle:
          type: string
          example: Revenue by channel
          description: Title of the sheet the report is now connected to
        created:
          type: boolean
          example: true
          description: >-
            True when the sheet was created, false when an existing sheet was
            reused
        changed:
          type: boolean
          example: true
          description: >-
            False when the report already pointed at a live sheet and nothing
            was rebound. The report is left untouched in that case — there was
            nothing to repair.
      required:
        - spreadsheetId
        - sheetId
        - sheetTitle
        - created
        - changed
    ReportOutputSchemaFieldApiDto:
      type: object
      properties:
        name:
          type: string
          description: Key each output row is keyed by
          example: revenue | SUM
        title:
          type: string
          description: Alias configured for the column; absent when there is none
          example: Revenue, $ | SUM
        description:
          type: string
          description: Field description from the Data Mart schema, when the column has one
        type:
          type: string
          description: Storage field type of the column, when known
          example: NUMERIC
        aggregateFunction:
          type: string
          description: >-
            The aggregate function the report applies to this column, when it
            applies one. Absent for a plain projected column.
          example: SUM
        calculatedFieldLevel:
          type: string
          description: >-
            Set only for a calculated field, carrying the level its formula was
            derived to have. `metric` means the formula AGGREGATES:
            re-aggregating it is wrong at any grain, whatever `type` says.
            `column` means it is row-level and behaves like a column of its
            declared type, but no warehouse column backs it. Absent means an
            ordinary native column, which a consumer may treat as re-summable —
            so do not read an absent value as 'unknown'.
          enum:
            - metric
            - column
      required:
        - name
    CreateInsightRequestApiDto:
      type: object
      properties:
        title:
          type: string
          example: Analysis Q4 2025
          maxLength: 255
        template:
          type: string
          example: Template text with prompts
      required:
        - title
    InsightResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: b1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890
        title:
          type: string
          example: Analysis Q4 2025
        template:
          type: object
          example: Template text with prompts
          nullable: true
        output:
          type: object
          example: 'Executive summary: ...'
          nullable: true
        outputUpdatedAt:
          type: object
          example: '2025-10-09T15:13:06.930Z'
          nullable: true
          description: Timestamp when the output field was last updated
        createdById:
          type: string
          example: 540734f6-8eb1-48a9-bf86-22010d3bddfd
        createdAt:
          type: object
          example: '2025-10-09T15:13:06.930Z'
        modifiedAt:
          type: object
          example: '2025-10-09T15:13:06.930Z'
        lastManualDataMartRun:
          nullable: true
          description: Latest manual DataMart run for this Insight
          type: object
          allOf:
            - $ref: '#/components/schemas/DataMartRunResponseApiDto'
      required:
        - id
        - title
        - createdById
        - createdAt
        - modifiedAt
    InsightListItemResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: b1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890
        title:
          type: string
          example: Analysis Q4 2025
        outputUpdatedAt:
          type: object
          example: '2025-10-09T15:13:06.930Z'
          nullable: true
          description: Timestamp when the output field was last updated
        createdById:
          type: string
          example: 540734f6-8eb1-48a9-bf86-22010d3bddfd
        createdAt:
          type: object
          example: '2025-10-09T15:13:06.930Z'
        modifiedAt:
          type: object
          example: '2025-10-09T15:13:06.930Z'
      required:
        - id
        - title
        - createdById
        - createdAt
        - modifiedAt
    UpdateInsightRequestApiDto:
      type: object
      properties:
        title:
          type: string
          example: New Title for Analysis Q4 2025
          maxLength: 255
        template:
          type: string
          example: New template text with prompts
      required:
        - title
    UpdateInsightTitleApiDto:
      type: object
      properties:
        title:
          type: string
          maxLength: 255
      required:
        - title
    AiAssistantScope:
      type: string
      enum:
        - template
    CreateAiAssistantSessionRequestApiDto:
      type: object
      properties:
        scope:
          example: template
          allOf:
            - $ref: '#/components/schemas/AiAssistantScope'
        templateId:
          type: string
          description: Insight Template id context for template scope
          example: 6f093b03-30c1-43e0-b9ed-6d87d33edf15
      required:
        - scope
        - templateId
    CreateAiAssistantSessionResponseApiDto:
      type: object
      properties:
        sessionId:
          type: string
          example: e7f7e087-2042-4de0-b1fc-67dddbaf88dd
          description: Created AI source assistant session id
      required:
        - sessionId
    AiAssistantSessionListItemResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: e7f7e087-2042-4de0-b1fc-67dddbaf88dd
        dataMartId:
          type: string
          example: a5c9b1d2-3456-7890-abcd-ef0123456789
        scope:
          example: template
          allOf:
            - $ref: '#/components/schemas/AiAssistantScope'
        title:
          type: object
          nullable: true
          example: Revenue by source
        templateId:
          type: object
          nullable: true
          example: 6f093b03-30c1-43e0-b9ed-6d87d33edf15
        createdAt:
          type: object
          example: '2026-02-15T16:10:06.930Z'
        updatedAt:
          type: object
          example: '2026-02-15T16:10:07.930Z'
      required:
        - id
        - dataMartId
        - scope
        - createdAt
        - updatedAt
    AiAssistantMessageRole:
      type: string
      enum:
        - user
        - assistant
        - system
    AiAssistantMessageApplyStatus:
      type: string
      enum:
        - none
        - pending
        - applied
      description: Apply lifecycle state for this assistant message
    AiAssistantMessageResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 4fce612f-6a4c-4ccf-a97d-92c69fd6230a
        sessionId:
          type: string
          example: e7f7e087-2042-4de0-b1fc-67dddbaf88dd
        role:
          example: user
          allOf:
            - $ref: '#/components/schemas/AiAssistantMessageRole'
        content:
          type: string
          example: Show monthly consumption by product for 2025
        proposedActions:
          type: array
          items:
            type: object
          nullable: true
          description: Explicit list of available actions proposed by the assistant
        sqlCandidate:
          type: object
          nullable: true
          description: SQL candidate generated by assistant for apply/preview
          example: SELECT date, SUM(revenue) FROM orders GROUP BY date
        applyStatus:
          example: pending
          description: Apply lifecycle state for this assistant message
          allOf:
            - $ref: '#/components/schemas/AiAssistantMessageApplyStatus'
        appliedAt:
          type: object
          nullable: true
          example: '2026-02-20T18:20:00.000Z'
          description: Timestamp of successful apply
        appliedRequestId:
          type: object
          nullable: true
          example: act_123
          description: Action request id that was applied
        createdAt:
          type: object
          example: '2026-02-15T16:10:06.930Z'
      required:
        - id
        - sessionId
        - role
        - content
        - applyStatus
        - createdAt
    AiAssistantSessionResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: e7f7e087-2042-4de0-b1fc-67dddbaf88dd
        dataMartId:
          type: string
          example: a5c9b1d2-3456-7890-abcd-ef0123456789
        scope:
          example: template
          allOf:
            - $ref: '#/components/schemas/AiAssistantScope'
        title:
          type: object
          nullable: true
          example: Revenue by source
        templateId:
          type: object
          nullable: true
          example: 6f093b03-30c1-43e0-b9ed-6d87d33edf15
        createdById:
          type: string
          example: '0'
        createdAt:
          type: object
          example: '2026-02-15T16:10:06.930Z'
        updatedAt:
          type: object
          example: '2026-02-15T16:10:07.930Z'
        messages:
          type: array
          items:
            $ref: '#/components/schemas/AiAssistantMessageResponseApiDto'
      required:
        - id
        - dataMartId
        - scope
        - createdById
        - createdAt
        - updatedAt
        - messages
    UpdateAiAssistantSessionTitleRequestApiDto:
      type: object
      properties:
        title:
          type: string
          maxLength: 255
      required:
        - title
    CreateAiAssistantMessageRequestApiDto:
      type: object
      properties:
        text:
          type: string
          description: New user message text
          example: Build SQL source with monthly product consumption for 2025
      required:
        - text
    AiAssistantExecutionModeApi:
      type: string
      enum:
        - lightweight
        - heavy
    CreateAiAssistantMessageResponseApiDto:
      type: object
      properties:
        mode:
          example: lightweight
          allOf:
            - $ref: '#/components/schemas/AiAssistantExecutionModeApi'
        triggerId:
          type: object
          nullable: true
          description: Trigger id for heavy route execution
          example: 550e8400-e29b-41d4-a716-446655440000
        response:
          type: object
          nullable: true
          description: Lightweight assistant response payload
          example:
            status: cannot_answer
            decision: explain_or_status
            explanation: AI source orchestration is not configured yet.
            meta:
              lastUserMessage: Build SQL source
              sanitizedLastUserMessage: Build SQL source
              reasonDescription: Session API endpoint is available.
              telemetry:
                llmCalls: []
                toolCalls: []
                messageHistory: []
        userMessage:
          $ref: '#/components/schemas/AiAssistantMessageResponseApiDto'
        assistantMessage:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/AiAssistantMessageResponseApiDto'
      required:
        - mode
        - userMessage
    ApplyAiAssistantSessionRequestApiDto:
      type: object
      properties:
        requestId:
          type: string
          description: Apply action id returned in assistant response.proposedActions[].id
          example: act_7ce2f8ad0ea74745a43fc3ae59f2f8f8_0
        assistantMessageId:
          type: string
          description: Assistant message id that owns selected apply action
          example: 57bba70a-8ad8-4edc-8b3e-ec45f51dc486
        sql:
          type: string
          description: >-
            SQL override. When omitted, latest SQL candidate from assistant
            message is used
          example: SELECT * FROM ${DATA_MART_TABLE}
        sourceTitle:
          type: string
          description: Title override for created or updated source
          example: Monthly product consumption source
      required:
        - requestId
        - assistantMessageId
    ApplyAiAssistantSessionResponseApiDto:
      type: object
      properties:
        requestId:
          type: string
          description: Idempotency key associated with apply operation
          example: 8ea56dbc-f6ad-47a4-9f05-f7c4e7594ecb
        artifactId:
          type: object
          description: Artifact id that received SQL apply
          nullable: true
          example: 6742f3e8-1a02-4642-bbf4-e7f8710f9507
        sourceTitle:
          type: object
          description: Source title after apply
          nullable: true
          example: Monthly product consumption source
        templateUpdated:
          type: boolean
          description: Whether template sources/template text changed
          example: true
        templateId:
          type: object
          description: Template id that was updated
          nullable: true
          example: 6f093b03-30c1-43e0-b9ed-6d87d33edf15
        sourceKey:
          type: object
          description: Source key added/used in template
          nullable: true
          example: monthly_consumption
        status:
          type: string
          description: Structured apply status
          enum:
            - updated
            - already_present
            - no_op
            - validation_failed
          example: updated
        reason:
          type: object
          description: Optional structured reason for apply status
          nullable: true
          example: replace_template_document
      required:
        - requestId
        - templateUpdated
        - status
    CreateInsightArtifactRequestApiDto:
      type: object
      properties:
        title:
          type: string
          example: Source
          maxLength: 255
        sql:
          type: string
          example: SELECT * FROM table LIMIT 100
      required:
        - title
        - sql
    InsightArtifactResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: fd6b79dd-72f5-4c8b-aec9-cf12024259d4
        title:
          type: string
          example: Source
        sql:
          type: string
          example: SELECT * FROM table LIMIT 100
        validationStatus:
          type: string
          enum:
            - VALID
            - ERROR
        validationError:
          type: object
          nullable: true
          example: null
        createdById:
          type: string
          example: 540734f6-8eb1-48a9-bf86-22010d3bddfd
        createdAt:
          type: object
          example: '2026-02-14T15:13:06.930Z'
        modifiedAt:
          type: object
          example: '2026-02-14T15:13:06.930Z'
      required:
        - id
        - title
        - sql
        - validationStatus
        - createdById
        - createdAt
        - modifiedAt
    InsightArtifactListItemResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: fd6b79dd-72f5-4c8b-aec9-cf12024259d4
        title:
          type: string
          example: Source
        validationStatus:
          type: string
          enum:
            - VALID
            - ERROR
        validationError:
          type: object
          nullable: true
          example: null
        createdById:
          type: string
          example: 540734f6-8eb1-48a9-bf86-22010d3bddfd
        createdAt:
          type: object
          example: '2026-02-14T15:13:06.930Z'
        modifiedAt:
          type: object
          example: '2026-10-14T15:13:06.930Z'
      required:
        - id
        - title
        - validationStatus
        - createdById
        - createdAt
        - modifiedAt
    UpdateInsightArtifactRequestApiDto:
      type: object
      properties:
        title:
          type: string
          example: Source (updated)
          maxLength: 255
        sql:
          type: string
          example: SELECT order_id, amount FROM table LIMIT 100
      required:
        - title
        - sql
    UpdateInsightArtifactTitleApiDto:
      type: object
      properties:
        title:
          type: string
          maxLength: 255
      required:
        - title
    RunInsightArtifactSqlPreviewRequestApiDto:
      type: object
      properties:
        sql:
          type: string
          description: Optional SQL override. If omitted, saved artifact SQL is executed.
          example: SELECT * FROM table LIMIT 10
    InsightTemplateSourceApiDto:
      type: object
      properties:
        templateSourceId:
          type: object
          nullable: true
        key:
          type: string
          example: last_30d
          maxLength: 64
        type:
          type: string
          enum:
            - CURRENT_DATA_MART
            - INSIGHT_ARTIFACT
        artifactId:
          type: object
          nullable: true
      required:
        - key
        - type
    CreateInsightTemplateRequestApiDto:
      type: object
      properties:
        title:
          type: string
          example: Summary
          maxLength: 255
        template:
          type: string
          example: |-
            ### Summary
            {{table source="main"}}
        sources:
          type: array
          items:
            $ref: '#/components/schemas/InsightTemplateSourceApiDto'
      required:
        - title
    InsightTemplateResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: b1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890
        title:
          type: string
          example: Summary
        template:
          type: object
          example: |-
            ### Summary
            {{table source="main"}}
          nullable: true
        sources:
          type: array
          items:
            $ref: '#/components/schemas/InsightTemplateSourceApiDto'
        lastRenderedTemplate:
          type: object
          nullable: true
        lastRenderedTemplateUpdatedAt:
          type: object
          nullable: true
        createdById:
          type: string
          example: 540734f6-8eb1-48a9-bf86-22010d3bddfd
        createdAt:
          type: object
          example: '2026-02-14T15:13:06.930Z'
        modifiedAt:
          type: object
          example: '2026-02-14T15:13:06.930Z'
        lastManualDataMartRun:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/DataMartRunResponseApiDto'
        createdByUser:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
      required:
        - id
        - title
        - template
        - sources
        - lastRenderedTemplate
        - lastRenderedTemplateUpdatedAt
        - createdById
        - createdAt
        - modifiedAt
        - lastManualDataMartRun
    InsightTemplateListItemResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: b1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890
        title:
          type: string
          example: Summary
        sourcesCount:
          type: number
          example: 1
          description: Number of configured sources in template
        lastRenderedTemplateUpdatedAt:
          type: object
          nullable: true
        createdById:
          type: string
          example: 540734f6-8eb1-48a9-bf86-22010d3bddfd
        createdAt:
          type: object
          example: '2026-02-14T15:13:06.930Z'
        modifiedAt:
          type: object
          example: '2026-02-14T15:13:06.930Z'
        createdByUser:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
      required:
        - id
        - title
        - sourcesCount
        - lastRenderedTemplateUpdatedAt
        - createdById
        - createdAt
        - modifiedAt
    UpdateInsightTemplateRequestApiDto:
      type: object
      properties:
        title:
          type: string
          example: Summary (updated)
          maxLength: 255
        template:
          type: string
          example: |-
            ## Updated
            {{table source="main"}}
        sources:
          type: array
          items:
            $ref: '#/components/schemas/InsightTemplateSourceApiDto'
      required:
        - title
    UpdateInsightTemplateTitleApiDto:
      type: object
      properties:
        title:
          type: string
          maxLength: 255
      required:
        - title
    InsightTemplateSourceDetailsApiDto:
      type: object
      properties:
        templateSourceId:
          type: string
          example: 2c8f6b71-7f8f-4e8e-8f31-5f6fd4e2a0f4
        key:
          type: string
          example: projects_2025
        artifactId:
          type: string
          example: be08ff51-8d9f-4a4f-9751-7fc534835755
        title:
          type: string
          example: Projects created in 2025
        sql:
          type: string
          example: >-
            SELECT COUNT(*) AS value FROM projects WHERE EXTRACT(YEAR FROM
            created_at) = 2025
        validationStatus:
          type: string
          enum:
            - VALID
            - ERROR
        validationError:
          type: object
          nullable: true
          example: null
        createdById:
          type: string
          example: 540734f6-8eb1-48a9-bf86-22010d3bddfd
        createdAt:
          type: object
          example: '2026-03-03T11:28:33.000Z'
        modifiedAt:
          type: object
          example: '2026-03-03T11:31:47.000Z'
      required:
        - templateSourceId
        - key
        - artifactId
        - title
        - sql
        - validationStatus
        - createdById
        - createdAt
        - modifiedAt
    CreateInsightTemplateSourceRequestApiDto:
      type: object
      properties:
        key:
          type: string
          example: projects_2025
          maxLength: 64
        title:
          type: string
          example: Projects created in 2025
          maxLength: 255
        sql:
          type: string
          example: >-
            SELECT COUNT(*) AS value FROM projects WHERE EXTRACT(YEAR FROM
            created_at) = 2025
      required:
        - key
        - title
        - sql
    UpdateInsightTemplateSourceRequestApiDto:
      type: object
      properties:
        title:
          type: string
          example: Projects created in 2025 (updated)
          maxLength: 255
        sql:
          type: string
          example: >-
            SELECT COUNT(1) AS value FROM projects WHERE created_at >=
            '2025-01-01' AND created_at < '2026-01-01'
      required:
        - title
        - sql
    ConnectorDefinitionResponseApiDto:
      type: object
      properties:
        name:
          type: string
          example: FacebookMarketing
        title:
          type: string
          example: Facebook Marketing
        description:
          type: object
          example: Connect to Facebook Marketing API
          nullable: true
        logo:
          type: object
          example: base64-encoded-logo
          nullable: true
        docUrl:
          type: object
          example: https://docs.owox.com/packages/connectors/src/sources/tik-tok-ads/readme/
          nullable: true
      required:
        - name
        - title
        - description
        - logo
        - docUrl
    ConnectorSpecificationItemResponseApiDto:
      type: object
      properties:
        name:
          type: string
          example: accessToken
        title:
          type: string
          example: Access Token
        description:
          type: string
          example: Your Facebook access token
        default:
          type: object
          example: default_value
        requiredType:
          type: string
          enum:
            - string
            - number
            - boolean
            - bool
            - object
            - array
            - date
          example: string
        required:
          type: boolean
          example: true
        options:
          example:
            - option1
            - option2
          type: array
          items:
            type: string
        placeholder:
          type: string
          example: Enter your access token...
        minimum:
          type: number
          example: 1
        attributes:
          example:
            - MANUAL_BACKFILL
            - HIDE_IN_UI
          type: array
          items:
            type: string
        optionsDependsOn:
          example:
            - AuthType
            - SpreadsheetId
          description: >-
            Configuration fields that must be filled before the dynamic options
            of this field can be loaded (DYNAMIC_OPTIONS attribute).
          type: array
          items:
            type: string
      required:
        - name
    ConnectorSpecificationOneOfOptionResponseApiDto:
      type: object
      properties:
        label:
          type: string
          example: Access Token
        value:
          type: string
          example: accessToken
        requiredType:
          type: string
          enum:
            - string
            - number
            - boolean
            - bool
            - object
            - array
            - date
          example: string
        attributes:
          example:
            - SECRET
            - OAUTH_FLOW
          type: array
          items:
            type: string
        items:
          example:
            - name: apiKey
              title: API Key
              description: Your API key
              default: default_value
              requiredType: string
              required: true
              options:
                - option1
                - option2
              placeholder: Enter your API key...
              attributes:
                - MANUAL_BACKFILL
                - HIDE_IN_UI
          type: array
          items:
            $ref: '#/components/schemas/ConnectorSpecificationItemResponseApiDto'
      required:
        - label
        - value
        - items
    ConnectorSpecificationResponseApiDto:
      type: object
      properties:
        name:
          type: string
          example: accessToken
        title:
          type: string
          example: Access Token
        description:
          type: string
          example: Your Facebook access token
        default:
          type: object
          example: default_value
        requiredType:
          type: string
          enum:
            - string
            - number
            - boolean
            - bool
            - object
            - array
            - date
          example: string
        required:
          type: boolean
          example: true
        options:
          example:
            - option1
            - option2
          type: array
          items:
            type: string
        placeholder:
          type: string
          example: Enter your access token...
        minimum:
          type: number
          example: 1
        attributes:
          example:
            - MANUAL_BACKFILL
            - HIDE_IN_UI
          type: array
          items:
            type: string
        optionsDependsOn:
          example:
            - AuthType
            - SpreadsheetId
          description: >-
            Configuration fields that must be filled before the dynamic options
            of this field can be loaded (DYNAMIC_OPTIONS attribute).
          type: array
          items:
            type: string
        oneOf:
          example:
            - label: Access Token
              value: accessToken
              requiredType: string
              items:
                - name: apiKey
                  title: API Key
                  description: Your API key
                  default: default_value
                  requiredType: string
                  required: true
                  options:
                    - option1
                    - option2
                  placeholder: Enter your API key...
                  attributes:
                    - MANUAL_BACKFILL
                    - HIDE_IN_UI
          type: array
          items:
            $ref: '#/components/schemas/ConnectorSpecificationOneOfOptionResponseApiDto'
      required:
        - name
    ConnectorFieldsResponseApiDto:
      type: object
      properties:
        name:
          type: string
          example: field_name
        overview:
          type: string
          example: Field Overview
        description:
          type: string
          example: Field Description
        documentation:
          type: string
          example: Field Documentation
        defaultFields:
          example:
            - field1
            - field2
          type: array
          items:
            type: string
        fields:
          example: Field Fields
          type: array
          items:
            type: string
      required:
        - name
    ConnectorFieldsPreviewRequestApiDto:
      type: object
      properties:
        configuration:
          type: object
          description: Connector source configuration used to detect dynamic fields.
        dataMartId:
          type: string
          description: >-
            Data Mart whose saved configuration is previewed; lets its editors
            preview with the Credential bound to that configuration.
      required:
        - configuration
    ConnectorFieldOptionsPreviewRequestApiDto:
      type: object
      properties:
        field:
          type: string
          example: SheetName
          maxLength: 128
          description: Configuration field declared with the DYNAMIC_OPTIONS attribute.
        configuration:
          type: object
          description: >-
            Connector source configuration. Only the fields listed in
            optionsDependsOn of the requested field have to be filled.
        dataMartId:
          type: string
          description: >-
            Data Mart whose saved configuration is previewed; lets its editors
            preview with the Credential bound to that configuration.
      required:
        - field
        - configuration
    ConnectorFieldOptionResponseApiDto:
      type: object
      properties:
        value:
          type: string
          example: Sheet1
          description: Value to store in the configuration
        label:
          type: string
          example: Sheet1
          description: Human-readable label
        url:
          type: string
          example: https://docs.google.com/spreadsheets/d/1AbC/edit#gid=0
          description: >-
            Link that opens this value in the provider, when the source provides
            one
      required:
        - value
        - label
    ConnectorOAuthSettingsResponseApiDto:
      type: object
      properties:
        vars:
          type: object
          example:
            AppId: '718780528197362'
            Scopes: ads_read,business_management
          description: OAuth UI variables with resolved environment variable templates
        isEnabled:
          type: boolean
          example: true
          description: >-
            Whether OAuth is enabled (all required environment variables are
            configured)
      required:
        - vars
        - isEnabled
    ExchangeOAuthCredentialTargetDto:
      type: object
      properties:
        id:
          type: string
          description: Reconnect this Credential instead of creating one.
        title:
          type: string
          description: Defaults to the account name, else the type name.
        contextIds:
          type: array
          items:
            type: string
        ownerIds:
          type: array
          items:
            type: string
        availableForUse:
          type: boolean
          default: false
        availableForMaintenance:
          type: boolean
          default: false
    ExchangeOAuthCredentialsDto:
      type: object
      properties:
        fieldPath:
          type: string
          example: AuthType.oauth2
        payload:
          type: object
          example:
            accessToken: '1234567890'
        credential:
          description: >-
            Send `{}` to create a Credential. A request without it is refused:
            "This page is out of date. Reload it."
          allOf:
            - $ref: '#/components/schemas/ExchangeOAuthCredentialTargetDto'
      required:
        - fieldPath
        - payload
    ConnectorOAuthStatusUserApiDto:
      type: object
      properties:
        id:
          type: string
          example: '1234567890'
        name:
          type: string
          example: John Doe
        email:
          type: string
          example: john.doe@example.com
        picture:
          type: string
          example: https://example.com/picture.jpg
      required:
        - id
        - name
        - email
        - picture
    ConnectorOAuthCredentialsResponseApiDto:
      type: object
      properties:
        success:
          type: boolean
          example: true
        credentialId:
          type: string
          description: The Credential id
          example: '1234567890'
        user:
          $ref: '#/components/schemas/ConnectorOAuthStatusUserApiDto'
        reasons:
          example:
            - Invalid credentials
          type: array
          items:
            type: string
      required:
        - success
        - credentialId
        - user
        - reasons
    ConnectorOAuthStatusResponseApiDto:
      type: object
      properties:
        valid:
          type: boolean
          example: true
        expiresAt:
          type: object
          example: '2025-10-09T15:13:06.930Z'
        user:
          $ref: '#/components/schemas/ConnectorOAuthStatusUserApiDto'
        additional:
          type: object
          example:
            scope: read,write
      required:
        - valid
        - expiresAt
        - user
        - additional
    CustomConnectorListItemResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        name:
          type: string
          example: MyCustomApi
        title:
          type: string
          example: My Custom API
        description:
          type: string
          example: Reads orders from our internal API
          nullable: true
        logo:
          type: string
          example: base64-encoded-logo
          nullable: true
        docUrl:
          type: string
          example: https://docs.example.com/my-api
          nullable: true
        activeVersionId:
          type: string
          example: 0f1e2d3c-4b5a-4c6d-8e9f-0a1b2c3d4e5f
          nullable: true
          description: >-
            Id of the version currently served to runs. Null until something is
            published.
        activeVersion:
          type: integer
          example: 1
          minimum: 1
          nullable: true
          description: Version number behind activeVersionId, resolved for display.
      required:
        - id
        - name
        - title
        - description
        - logo
        - docUrl
        - activeVersionId
        - activeVersion
    CreateCustomConnectorRequestApiDto:
      type: object
      properties:
        name:
          type: string
          example: MyCustomApi
          maxLength: 255
        title:
          type: string
          example: My Custom API
          maxLength: 255
        description:
          type: string
        logo:
          type: string
        docUrl:
          type: string
          maxLength: 255
        manifest:
          type: object
          additionalProperties: true
      required:
        - name
        - title
        - manifest
    CreateCustomConnectorResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        name:
          type: string
          example: MyCustomApi
        title:
          type: string
          example: My Custom API
      required:
        - id
        - name
        - title
    TestConnectorRequestApiDto:
      type: object
      properties:
        manifest:
          type: object
          additionalProperties: true
        node:
          type: string
          example: items
        configuration:
          type: object
          additionalProperties: true
        maxRows:
          type: number
        maxPages:
          type: number
        credentialId:
          type: string
          description: >-
            A Credential whose values the server merges into the configuration,
            which then carries no key parameter.
      required:
        - manifest
        - node
        - configuration
    ConnectorTestResultResponseApiDto:
      type: object
      properties:
        rows:
          type: array
          items:
            type: object
            additionalProperties: true
          description: Records the node produced, capped by the request maxRows.
        logs:
          type: array
          items:
            type: string
        error:
          type: string
          example: null
          nullable: true
        sample:
          type: array
          items:
            type: object
            additionalProperties: true
          description: >-
            Raw upstream records captured for field discovery, before record
            selection.
      required:
        - rows
        - logs
        - error
        - sample
    FittingCustomConnectorCredentialsRequestApiDto:
      type: object
      properties:
        manifest:
          type: object
          additionalProperties: true
        connectorName:
          type: string
          description: A published custom connector, in place of a manifest.
        version:
          type: number
          description: With connectorName; the active version when absent.
        node:
          type: string
          example: items
          description: >-
            The node a test runs; only it is fitted. The whole manifest when
            absent.
        selection:
          type: string
          description: The selective authentication branch the test or configuration picks.
    FittingCustomConnectorCredentialRefusalApiDto:
      type: object
      properties:
        reason:
          type: string
          enum:
            - unfit
            - misuse
            - secret
        message:
          type: string
          description: Copy the UI can show.
      required:
        - reason
        - message
    FittingCustomConnectorCredentialResponseApiDto:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        hosts:
          type: array
          items:
            type: string
        fieldKeys:
          description: Parameter names the Credential holds values for.
          type: array
          items:
            type: string
        refusal:
          nullable: true
          description: >-
            Why the Credential cannot be chosen for the manifest; null when it
            fits.
          type: object
          allOf:
            - $ref: '#/components/schemas/FittingCustomConnectorCredentialRefusalApiDto'
      required:
        - id
        - title
        - hosts
        - fieldKeys
        - refusal
    CustomConnectorRequirementFieldResponseApiDto:
      type: object
      properties:
        key:
          type: string
        label:
          type: string
        secret:
          type: boolean
        required:
          type: boolean
          description: False for an optional key parameter, which may be left out.
      required:
        - key
        - label
        - secret
        - required
    CustomConnectorCredentialRequirementResponseApiDto:
      type: object
      properties:
        hosts:
          description: Bare hostnames a fitting Credential must allow.
          type: array
          items:
            type: string
        fieldList:
          description: >-
            The key parameters of the selection, generated ones aside; empty
            until a selective branch is picked.
          type: array
          items:
            $ref: '#/components/schemas/CustomConnectorRequirementFieldResponseApiDto'
        keyParameters:
          description: >-
            Every key parameter of every branch; a configuration never holds a
            value for one.
          type: array
          items:
            type: string
        selectionParameter:
          type: string
          description: The parameter that picks a selective branch.
        misuse:
          description: >-
            The run error for each key parameter the manifest uses where no
            request is built; no Credential fits while any is listed.
          type: array
          items:
            type: string
      required:
        - hosts
        - fieldList
        - keyParameters
        - misuse
    CustomConnectorVersionSummaryResponseApiDto:
      type: object
      properties:
        version:
          type: integer
          example: 1
          minimum: 1
        status:
          type: string
          enum:
            - draft
            - published
          example: draft
        publishedAt:
          type: string
          format: date-time
          example: '2024-01-02T15:30:00.000Z'
          nullable: true
          description: Null while the version is still a draft.
      required:
        - version
        - status
        - publishedAt
    CustomConnectorDetailResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        name:
          type: string
          example: MyCustomApi
        title:
          type: string
          example: My Custom API
        description:
          type: string
          example: Reads orders from our internal API
          nullable: true
        logo:
          type: string
          example: base64-encoded-logo
          nullable: true
        docUrl:
          type: string
          example: https://docs.example.com/my-api
          nullable: true
        activeVersionId:
          type: string
          example: 0f1e2d3c-4b5a-4c6d-8e9f-0a1b2c3d4e5f
          nullable: true
          description: >-
            Id of the version currently served to runs. Null until something is
            published.
        activeVersion:
          type: integer
          example: 1
          minimum: 1
          nullable: true
          description: Version number behind activeVersionId, resolved for display.
        versions:
          description: Every version of this connector, oldest first.
          type: array
          items:
            $ref: '#/components/schemas/CustomConnectorVersionSummaryResponseApiDto'
      required:
        - id
        - name
        - title
        - description
        - logo
        - docUrl
        - activeVersionId
        - activeVersion
        - versions
    UpdateCustomConnectorRequestApiDto:
      type: object
      properties:
        title:
          type: string
          example: My Custom API
          maxLength: 255
        description:
          type: string
          nullable: true
        logo:
          type: string
          nullable: true
        docUrl:
          type: string
          nullable: true
          maxLength: 255
    CustomConnectorVersionResponseApiDto:
      type: object
      properties:
        version:
          type: integer
          example: 1
          minimum: 1
        status:
          type: string
          enum:
            - draft
            - published
          example: draft
        manifest:
          type: object
          additionalProperties: true
          description: The manifest stored for this version.
      required:
        - version
        - status
        - manifest
    SaveDraftRequestApiDto:
      type: object
      properties:
        manifest:
          type: object
          additionalProperties: true
      required:
        - manifest
    CustomConnectorVersionStateResponseApiDto:
      type: object
      properties:
        version:
          type: integer
          example: 1
          minimum: 1
        status:
          type: string
          enum:
            - draft
            - published
          example: draft
      required:
        - version
        - status
    StoppingDataMartApiDto:
      type: object
      properties:
        id:
          type: string
          example: 0f1e2d3c-4b5a-4c6d-8e9f-0a1b2c3d4e5f
        title:
          type: string
          example: Sales
      required:
        - id
        - title
    PublishCustomConnectorResponseApiDto:
      type: object
      properties:
        version:
          type: integer
          example: 1
          minimum: 1
        status:
          type: string
          enum:
            - draft
            - published
          example: draft
        publishedAt:
          type: string
          format: date-time
          example: '2024-01-02T15:30:00.000Z'
          nullable: true
        warnings:
          example:
            - >-
              Connector 'MyCustomApi' v3: "authentication" references undeclared
              parameter(s) Token.
          type: array
          items:
            type: string
        stoppingDataMarts:
          type: array
          items:
            $ref: '#/components/schemas/StoppingDataMartApiDto'
        hiddenStoppingCount:
          type: integer
          example: 0
          minimum: 0
      required:
        - version
        - status
        - warnings
        - stoppingDataMarts
        - hiddenStoppingCount
    ActivateCustomConnectorVersionResponseApiDto:
      type: object
      properties:
        activeVersionId:
          type: string
          example: 0f1e2d3c-4b5a-4c6d-8e9f-0a1b2c3d4e5f
          nullable: true
        activeVersion:
          type: integer
          example: 2
          minimum: 1
        stoppingDataMarts:
          type: array
          items:
            $ref: '#/components/schemas/StoppingDataMartApiDto'
        hiddenStoppingCount:
          type: integer
          example: 0
          minimum: 0
      required:
        - activeVersionId
        - activeVersion
        - stoppingDataMarts
        - hiddenStoppingCount
    DeleteCustomConnectorResponseApiDto:
      type: object
      properties:
        success:
          type: boolean
          example: true
      required:
        - success
    CreateScheduledTriggerRequestApiDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - REPORT_RUN
            - CONNECTOR_RUN
            - DATA_QUALITY_RUN
          example: CONNECTOR_RUN
        cronExpression:
          type: string
          example: 0 0 * * *
        timeZone:
          type: string
          example: UTC
        isActive:
          type: boolean
          example: true
        triggerConfig:
          type: object
      required:
        - type
        - cronExpression
        - timeZone
        - isActive
    ScheduledTriggerResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        type:
          type: string
          enum:
            - REPORT_RUN
            - CONNECTOR_RUN
            - DATA_QUALITY_RUN
          example: CONNECTOR_RUN
        cronExpression:
          type: string
          example: 0 0 * * *
        timeZone:
          type: string
          example: UTC
        isActive:
          type: boolean
          example: true
        nextRunTimestamp:
          type: object
          example: '2024-01-01T12:00:00.000Z'
          nullable: true
        lastRunTimestamp:
          type: object
          example: '2024-01-01T12:00:00.000Z'
          nullable: true
        triggerConfig:
          type: object
          nullable: true
        createdById:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        createdAt:
          format: date-time
          type: string
          example: '2024-01-01T12:00:00.000Z'
        modifiedAt:
          format: date-time
          type: string
          example: '2024-01-02T15:30:00.000Z'
        createdByUser:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
      required:
        - id
        - type
        - cronExpression
        - timeZone
        - isActive
        - nextRunTimestamp
        - lastRunTimestamp
        - triggerConfig
        - createdById
        - createdAt
        - modifiedAt
    UpdateScheduledTriggerRequestApiDto:
      type: object
      properties:
        cronExpression:
          type: string
          example: 0 0 * * *
        timeZone:
          type: string
          example: UTC
        isActive:
          type: boolean
          example: true
      required:
        - cronExpression
        - timeZone
        - isActive
    SqlDryRunRequestApiDto:
      type: object
      properties:
        sql:
          type: string
          description: SQL query to validate
          example: SELECT * FROM table_name
      required:
        - sql
    SqlDryRunResponseApiDto:
      type: object
      properties:
        isValid:
          type: boolean
          description: Whether the SQL query is valid
          example: true
        error:
          type: string
          description: Error message if validation failed
          example: Syntax error at line 1
        bytes:
          type: number
          description: Estimated bytes to be processed
          example: 1024
      required:
        - isValid
    PreviewDataMartRequestApiDto:
      type: object
      properties:
        limit:
          type: number
          description: How many rows to read from the warehouse. Defaults to 10.
          minimum: 1
          maximum: 1000
          example: 10
        filters:
          type: array
          description: >-
            WHERE filters on native fields, in the same rule format as a report
            filterConfig.
          items:
            type: object
        sort:
          type: array
          description: >-
            ORDER BY rules on native fields, in the same format as a report
            sortConfig.
          items:
            type: object
          example:
            - column: revenue
              direction: desc
    DataMartPreviewColumnApiDto:
      type: object
      properties:
        name:
          type: string
          example: country
        alias:
          type: string
          example: Country Name
        type:
          type: string
          example: STRING
          description: Storage field type
      required:
        - name
    PreviewDataMartResponseApiDto:
      type: object
      properties:
        columns:
          type: array
          items:
            $ref: '#/components/schemas/DataMartPreviewColumnApiDto'
        rows:
          type: array
          description: Rows in column order; RECORD/ARRAY values are JSON text
          items:
            type: array
            items: {}
        rowCount:
          type: number
          example: 10
        limit:
          type: number
          example: 10
        truncated:
          type: boolean
          description: More rows matched than the limit
      required:
        - columns
        - rows
        - rowCount
        - limit
        - truncated
    CreateAiHelperTriggerRequestApiDto:
      type: object
      properties:
        scope:
          type: string
          enum:
            - title
            - description
            - field_alias
            - field_description
            - all_field_descriptions
            - all_field_aliases
            - all_field_metadata
          description: >-
            What metadata to generate. Use "all_field_*" scopes to populate
            every field; use "field_alias" or "field_description" together with
            `fieldName` to generate a single field value.
        useSample:
          type: boolean
          description: >-
            When true, the data mart is run to fetch up to 30 sample rows that
            ground the AI in real values. When false, generation uses only
            column names and types (lower quality).
          default: true
        fieldName:
          type: string
          description: >-
            Required when scope is "field_alias" or "field_description". Must
            match an existing field name in the data mart schema.
      required:
        - scope
        - useSample
    GeneratedFieldMetadataApiDto:
      type: object
      properties:
        name:
          type: string
          description: Exact field name as in the data mart schema
        alias:
          type: string
          description: Business-friendly display name
        description:
          type: string
          description: Business-friendly description, one sentence
    GenerateDataMartMetadataResponseApiDto:
      type: object
      properties:
        title:
          type: string
          description: Suggested data mart title
        description:
          type: string
          description: Suggested data mart description
        fields:
          description: Per-field suggestions
          type: array
          items:
            $ref: '#/components/schemas/GeneratedFieldMetadataApiDto'
    AiHelperTriggerResponseApiDto:
      type: object
      properties:
        result:
          description: AI-generated metadata. Present when the trigger succeeded.
          allOf:
            - $ref: '#/components/schemas/GenerateDataMartMetadataResponseApiDto'
        error:
          type: string
          description: >-
            Human-readable error message. Present when the trigger errored.
            Surfaced to the user as a toast.
    InsightRunTriggerListItemResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
        insightId:
          type: string
          example: 8a0d9a7c-4a1d-4a5d-8f2a-9b6f3d1c2e4b
        status:
          type: string
          enum:
            - IDLE
            - READY
            - PROCESSING
            - SUCCESS
            - ERROR
            - CANCELLING
            - CANCELLED
          example: IDLE
          description: Current trigger status
        uiResponse:
          type: object
          description: UI response for this trigger (e.g., { runId } or { error })
          nullable: true
        createdAt:
          type: object
          example: '2025-10-09T15:13:06.930Z'
        modifiedAt:
          type: object
          example: '2025-10-09T15:20:11.525Z'
      required:
        - id
        - insightId
        - status
        - uiResponse
        - createdAt
        - modifiedAt
    CreateInsightTemplateRunTriggerRequestApiDto:
      type: object
      properties:
        type:
          type: string
          description: Source of the Run Insight request
          enum:
            - manual
            - chat
          example: manual
        assistantMessageId:
          type: string
          description: Assistant message id that initiated Apply & Run
          example: 57bba70a-8ad8-4edc-8b3e-ec45f51dc486
      required:
        - type
    InsightTemplateRunTriggerListItemResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
        insightTemplateId:
          type: string
          example: 8a0d9a7c-4a1d-4a5d-8f2a-9b6f3d1c2e4b
        status:
          type: string
          enum:
            - IDLE
            - READY
            - PROCESSING
            - SUCCESS
            - ERROR
            - CANCELLING
            - CANCELLED
          example: IDLE
        uiResponse:
          type: object
          nullable: true
        createdAt:
          type: object
          example: '2026-02-14T15:13:06.930Z'
        modifiedAt:
          type: object
          example: '2026-02-14T15:20:11.525Z'
      required:
        - id
        - insightTemplateId
        - status
        - uiResponse
        - createdAt
        - modifiedAt
    MarkdownParseRequestApiDto:
      type: object
      properties:
        markdown:
          type: string
          description: Markdown source to render with the OWOX Data Marts Markdown pipeline
          example: |-
            # Revenue

            **Net revenue** after refunds.
      required:
        - markdown
    ProjectSetupStepStateApiDto:
      type: object
      properties:
        done:
          type: boolean
          description: Whether the setup step is complete
        completedAt:
          type: string
          format: date-time
          nullable: true
          description: When the setup step was completed, or null while incomplete
      required:
        - done
        - completedAt
    ProjectSetupStepsApiDto:
      type: object
      properties:
        hasStorage:
          $ref: '#/components/schemas/ProjectSetupStepStateApiDto'
        hasDraftDataMart:
          $ref: '#/components/schemas/ProjectSetupStepStateApiDto'
        hasPublishedDataMart:
          $ref: '#/components/schemas/ProjectSetupStepStateApiDto'
        hasDestination:
          $ref: '#/components/schemas/ProjectSetupStepStateApiDto'
        hasReport:
          $ref: '#/components/schemas/ProjectSetupStepStateApiDto'
        hasReportRun:
          $ref: '#/components/schemas/ProjectSetupStepStateApiDto'
        hasTeammatesInvited:
          $ref: '#/components/schemas/ProjectSetupStepStateApiDto'
        hasGoogleSheetsDestination:
          $ref: '#/components/schemas/ProjectSetupStepStateApiDto'
        hasGoogleSheetsExtension:
          $ref: '#/components/schemas/ProjectSetupStepStateApiDto'
        hasGoogleSheetsReportRun:
          $ref: '#/components/schemas/ProjectSetupStepStateApiDto'
        hasMcpQuery:
          $ref: '#/components/schemas/ProjectSetupStepStateApiDto'
      required:
        - hasStorage
        - hasDraftDataMart
        - hasPublishedDataMart
        - hasDestination
        - hasReport
        - hasReportRun
        - hasTeammatesInvited
        - hasGoogleSheetsDestination
        - hasGoogleSheetsExtension
        - hasGoogleSheetsReportRun
        - hasMcpQuery
    ProjectSetupProgressResponseApiDto:
      type: object
      properties:
        version:
          type: integer
          minimum: 1
          example: 1
          description: API contract version
        stepsSchemaVersion:
          type: integer
          minimum: 1
          example: 1
          description: Schema version of the persisted steps JSON
        progress:
          type: integer
          minimum: 0
          maximum: 100
          example: 42
          description: Percentage of completed steps (0..100)
        steps:
          description: Per-step state (project-scoped + user-scoped, merged)
          allOf:
            - $ref: '#/components/schemas/ProjectSetupStepsApiDto'
      required:
        - version
        - stepsSchemaVersion
        - progress
        - steps
    JoinConditionApiDto:
      type: object
      properties:
        sourceFieldName:
          type: string
          example: user_id
          description: Field name in the source data mart
        targetFieldName:
          type: string
          example: user_id
          description: Field name in the target data mart
      required:
        - sourceFieldName
        - targetFieldName
    CreateRelationshipRequestApiDto:
      type: object
      properties:
        targetDataMartId:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
          description: ID of the target data mart to blend with
        targetAlias:
          type: string
          example: orders
          description: Alias for the target data mart in the blend
          pattern: ^[a-z0-9_]+$
        joinConditions:
          description: Conditions used to join the data marts
          type: array
          items:
            $ref: '#/components/schemas/JoinConditionApiDto'
        description:
          type: string
          example: >-
            Visitors from the website sign up for the product and convert into
            users
          description: Business meaning of this relationship, shared with AI assistants
      required:
        - targetDataMartId
        - targetAlias
        - joinConditions
    DataMartRefApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        title:
          type: string
          example: My Data Mart
        description:
          type: string
          example: Revenue by channel
        status:
          type: string
          enum:
            - DRAFT
            - PUBLISHED
          example: PUBLISHED
        userHasAccess:
          type: boolean
          example: true
          description: Whether the requesting user has SEE access to this data mart
        hasPrimaryKey:
          type: boolean
          example: true
          description: >-
            Whether this data mart has at least one primary key field defined in
            its schema
      required:
        - id
        - title
        - status
        - userHasAccess
        - hasPrimaryKey
    RelationshipResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        dataStorageId:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        sourceDataMart:
          $ref: '#/components/schemas/DataMartRefApiDto'
        targetDataMart:
          $ref: '#/components/schemas/DataMartRefApiDto'
        targetAlias:
          type: string
          example: orders
        joinConditions:
          type: array
          items:
            type: string
        description:
          type: string
          example: >-
            Visitors from the website sign up for the product and convert into
            users
          description: Business meaning of this relationship, shared with AI assistants
        createdById:
          type: string
          example: user-id-123
        createdAt:
          format: date-time
          type: string
          example: '2024-01-01T12:00:00.000Z'
        modifiedAt:
          format: date-time
          type: string
          example: '2024-01-02T15:30:00.000Z'
        createdByUser:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
      required:
        - id
        - dataStorageId
        - sourceDataMart
        - targetDataMart
        - targetAlias
        - joinConditions
        - createdById
        - createdAt
        - modifiedAt
    RelationshipGraphNodeResponseApiDto:
      type: object
      properties:
        relationship:
          $ref: '#/components/schemas/RelationshipResponseApiDto'
        aliasPath:
          type: string
          example: orders.line_items
          description: >-
            Dot-separated alias path from the root data mart down to this
            relationship
        depth:
          type: number
          example: 2
          description: Distance from the root (root direct children = 1)
        isCycleStub:
          type: boolean
          example: false
          description: >-
            True when traversal reached an ancestor already on the path; the
            subtree below is not expanded
        isBlocked:
          type: boolean
          example: false
          description: >-
            Cumulative flag: true when any ancestor in the path is DRAFT or has
            no join conditions configured
      required:
        - relationship
        - aliasPath
        - depth
        - isCycleStub
        - isBlocked
    RelationshipGraphResponseApiDto:
      type: object
      properties:
        rootDataMartId:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        nodes:
          type: array
          items:
            $ref: '#/components/schemas/RelationshipGraphNodeResponseApiDto'
      required:
        - rootDataMartId
        - nodes
    UpdateRelationshipRequestApiDto:
      type: object
      properties:
        targetAlias:
          type: string
          example: orders
          description: Alias for the target data mart in the blend
          pattern: ^[a-z0-9_]+$
        joinConditions:
          description: Conditions used to join the data marts
          type: array
          items:
            $ref: '#/components/schemas/JoinConditionApiDto'
        description:
          type: object
          example: >-
            Visitors from the website sign up for the product and convert into
            users
          description: >-
            Business meaning of this relationship, shared with AI assistants.
            Values are trimmed; send null or a blank (empty/whitespace-only)
            string to clear it.
          nullable: true
    ModelCanvasNodeApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        title:
          type: string
          example: Orders
        status:
          type: string
          enum:
            - DRAFT
            - PUBLISHED
          example: PUBLISHED
        description:
          type: string
          example: All orders enriched with customer data
          nullable: true
        icon:
          type: string
          nullable: true
          example: purchases
          description: >-
            User-picked icon: A recommended icon key (e.g. `purchases`) or any
            lucide icon as `lucide:<icon-name>` (e.g. `lucide:shopping-cart`).
            null means the default icon.
        fieldCount:
          type: number
          example: 12
          description: Number of fields in the output schema
        triggersCount:
          type: number
          example: 2
          description: Number of scheduled triggers of the Data Mart
        reportsCount:
          type: number
          example: 3
          description: Number of reports built on the Data Mart
        dataLastUpdated:
          nullable: true
          description: >-
            Last-known Data Last Updated snapshot, without per-table detail.
            Null when never computed.
          type: object
          allOf:
            - $ref: '#/components/schemas/DataMartDataLastUpdatedSummaryApiDto'
      required:
        - id
        - title
        - status
        - description
        - icon
        - fieldCount
        - triggersCount
        - reportsCount
        - dataLastUpdated
    ModelCanvasDataMartsResponseApiDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ModelCanvasNodeApiDto'
        total:
          type: number
          example: 120
        nextOffset:
          type: number
          example: 50
          nullable: true
          description: Next offset to fetch, null if no more data
      required:
        - items
        - total
        - nextOffset
    ModelCanvasJoinConditionApiDto:
      type: object
      properties:
        sourceFieldName:
          type: string
          example: customer_id
        targetFieldName:
          type: string
          example: id
      required:
        - sourceFieldName
        - targetFieldName
    ModelCanvasEdgeApiDto:
      type: object
      properties:
        id:
          type: string
          example: 2f6c1f88-0000-4a5a-8b12-abcdef123456
        sourceDataMartId:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        targetDataMartId:
          type: string
          example: 7b1de930-5678-4c3b-9d34-fedcba654321
        joinConditions:
          type: array
          items:
            $ref: '#/components/schemas/ModelCanvasJoinConditionApiDto'
      required:
        - id
        - sourceDataMartId
        - targetDataMartId
        - joinConditions
    ModelCanvasEdgesResponseApiDto:
      type: object
      properties:
        edges:
          type: array
          items:
            $ref: '#/components/schemas/ModelCanvasEdgeApiDto'
      required:
        - edges
    CreateContextRequestApiDto:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
          nullable: true
        icon:
          type: string
          nullable: true
          example: lucide:megaphone
          description: >-
            A recommended icon key (e.g. `purchases`) or any lucide icon as
            `lucide:<icon-name>` (e.g. `lucide:shopping-cart`). Omit or null for
            the default icon.
      required:
        - name
    ContextResponseApiDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: object
        icon:
          type: string
          nullable: true
          example: lucide:megaphone
          description: >-
            User-picked icon: A recommended icon key (e.g. `purchases`) or any
            lucide icon as `lucide:<icon-name>` (e.g. `lucide:shopping-cart`).
            null means the default icon.
        createdById:
          type: object
        createdByUser:
          $ref: '#/components/schemas/UserProjectionDto'
        createdAt:
          format: date-time
          type: string
          example: '2024-01-01T12:00:00.000Z'
        modifiedAt:
          format: date-time
          type: string
          example: '2024-01-02T15:30:00.000Z'
      required:
        - id
        - name
        - icon
        - createdAt
        - modifiedAt
    UpdateContextRequestApiDto:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
          nullable: true
        icon:
          type: string
          nullable: true
          example: lucide:megaphone
          description: >-
            A recommended icon key (e.g. `purchases`) or any lucide icon as
            `lucide:<icon-name>` (e.g. `lucide:shopping-cart`). Omit to keep the
            current icon; null resets it to the default.
      required:
        - name
    UpdateContextIconApiDto:
      type: object
      properties:
        icon:
          type: string
          nullable: true
          example: lucide:megaphone
          description: >-
            A recommended icon key (e.g. `purchases`) or any lucide icon as
            `lucide:<icon-name>` (e.g. `lucide:shopping-cart`). null resets the
            Context to the default icon.
      required:
        - icon
    ContextImpactResponseApiDto:
      type: object
      properties:
        contextId:
          type: string
        contextName:
          type: string
        dataMartCount:
          type: number
          description: Data Marts attached to the context. Deleted ones are not counted.
        storageCount:
          type: number
          description: Storages attached to the context. Deleted ones are not counted.
        destinationCount:
          type: number
          description: Destinations attached to the context. Deleted ones are not counted.
        memberCount:
          type: number
          description: >-
            Non-admin members with Selected contexts scope assigned to the
            context. Admins and Entire project members are not counted.
        userProvisioningDefaultsCount:
          type: number
        affectedMemberIds:
          type: array
          items:
            type: string
      required:
        - contextId
        - contextName
        - dataMartCount
        - storageCount
        - destinationCount
        - memberCount
        - userProvisioningDefaultsCount
        - affectedMemberIds
    UpdateContextMembersRequestApiDto:
      type: object
      properties:
        assignedUserIds:
          description: >-
            Project member user ids to bind to this context. Admin ids are
            ignored.
          type: array
          items:
            type: string
      required:
        - assignedUserIds
    UpdateContextMembersResponseApiDto:
      type: object
      properties:
        assignedUserIds:
          type: array
          items:
            type: string
        droppedAdminIds:
          description: >-
            Admin user ids the caller tried to attach. Admins always have
            project-wide scope, so binding them to a context is a no-op. UI may
            surface a warning.
          type: array
          items:
            type: string
      required:
        - assignedUserIds
        - droppedAdminIds
    ProjectMemberResponseApiDto:
      type: object
      properties:
        userId:
          type: string
        email:
          type: string
        displayName:
          type: string
        avatarUrl:
          type: string
        role:
          type: string
          enum:
            - admin
            - editor
            - viewer
        roleScope:
          type: string
          enum:
            - entire_project
            - selected_contexts
        contextIds:
          type: array
          items:
            type: string
      required:
        - userId
        - email
        - role
        - roleScope
        - contextIds
    InviteMemberRequestApiDto:
      type: object
      properties:
        email:
          type: string
        role:
          type: string
          enum:
            - admin
            - editor
            - viewer
        roleScope:
          type: string
          enum:
            - entire_project
            - selected_contexts
          description: >-
            Explicit role scope for non-admin invitees. Ignored when role=admin
            (admins are always entire_project). If omitted, scope is inferred
            from contextIds (non-empty → selected_contexts, empty →
            entire_project) for backwards compatibility.
        contextIds:
          type: array
          items:
            type: string
      required:
        - email
        - role
    InviteMemberResponseApiDto:
      type: object
      properties:
        email:
          type: string
        kind:
          type: string
          enum:
            - email-sent
            - magic-link
        role:
          type: string
          enum:
            - admin
            - editor
            - viewer
        magicLink:
          type: string
          description: >-
            Present when `kind` is `magic-link`. Admin shares this link
            manually.
        expiresAt:
          type: string
        message:
          type: string
        userId:
          type: string
          description: >-
            Pre-provisioned user id from the IDP. Present when the backend could
            attach authorization scope immediately. Absent for IDPs that only
            materialise the user on first sign-in.
      required:
        - email
        - kind
        - role
    UserProvisioningOrganizationApiDto:
      type: object
      properties:
        name:
          type: string
        mainProjectId:
          type: object
          nullable: true
        mainProjectTitle:
          type: object
          nullable: true
      required:
        - name
    UserProvisioningSettingsValueApiDto:
      type: object
      properties:
        mode:
          type: string
          enum:
            - automatic
            - manual
        defaultRole:
          type: string
          enum:
            - admin
            - editor
            - viewer
        roleScope:
          type: string
          enum:
            - entire_project
            - selected_contexts
        contextIds:
          type: array
          items:
            type: string
      required:
        - mode
        - defaultRole
        - roleScope
        - contextIds
    UserProvisioningSettingsResponseApiDto:
      type: object
      properties:
        isApplicable:
          type: boolean
        isMainProject:
          type: boolean
        organization:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProvisioningOrganizationApiDto'
        settings:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProvisioningSettingsValueApiDto'
      required:
        - isApplicable
        - isMainProject
    UpdateUserProvisioningSettingsRequestApiDto:
      type: object
      properties:
        mode:
          type: string
          enum:
            - automatic
            - manual
        defaultRole:
          type: string
          enum:
            - admin
            - editor
            - viewer
        roleScope:
          type: string
          enum:
            - entire_project
            - selected_contexts
        contextIds:
          type: array
          items:
            type: string
      required:
        - mode
        - defaultRole
        - roleScope
        - contextIds
    UpdateMemberRequestApiDto:
      type: object
      properties:
        role:
          type: string
          enum:
            - admin
            - editor
            - viewer
        roleScope:
          type: string
          enum:
            - entire_project
            - selected_contexts
        contextIds:
          type: array
          items:
            type: string
      required:
        - role
        - roleScope
        - contextIds
    UpdateMemberResponseApiDto:
      type: object
      properties:
        userId:
          type: string
        role:
          type: string
          enum:
            - admin
            - editor
            - viewer
        roleScope:
          type: string
          enum:
            - entire_project
            - selected_contexts
        contextIds:
          type: array
          items:
            type: string
        roleStatus:
          type: string
          enum:
            - ok
            - pending
        message:
          type: string
      required:
        - userId
        - role
        - roleScope
        - contextIds
        - roleStatus
    MembershipRequestApiDto:
      type: object
      properties:
        requestId:
          type: string
        email:
          type: string
        fullName:
          type: string
        avatar:
          type: string
        userId:
          type: string
        requestedRole:
          type: string
          enum:
            - admin
            - editor
            - viewer
        createdAt:
          type: string
      required:
        - requestId
        - email
        - requestedRole
        - createdAt
    ApproveMembershipRequestApiDto:
      type: object
      properties:
        role:
          type: string
          enum:
            - admin
            - editor
            - viewer
        roleScope:
          type: string
          enum:
            - entire_project
            - selected_contexts
        contextIds:
          type: array
          items:
            type: string
      required:
        - role
    ApproveMembershipRequestResponseApiDto:
      type: object
      properties:
        userId:
          type: string
        role:
          type: string
          enum:
            - admin
            - editor
            - viewer
        roleScope:
          type: string
          enum:
            - entire_project
            - selected_contexts
        contextIds:
          type: array
          items:
            type: string
      required:
        - userId
        - role
        - roleScope
        - contextIds
    ProjectMemberApiKeyResponseDto:
      type: object
      properties:
        apiKeyId:
          type: string
        name:
          type: string
        expiresAt:
          type: object
          nullable: true
        createdAt:
          type: string
        lastAuthenticatedAt:
          type: object
          nullable: true
      required:
        - apiKeyId
        - name
        - expiresAt
        - createdAt
        - lastAuthenticatedAt
    CreateProjectMemberApiKeyRequestDto:
      type: object
      properties:
        name:
          type: string
          description: User-facing name for the API key
        expiresAt:
          type: string
          description: Optional expiration date (ISO 8601)
      required:
        - name
    CreateProjectMemberApiKeyResponseDto:
      type: object
      properties:
        apiKeyId:
          type: string
        name:
          type: string
        expiresAt:
          type: object
          nullable: true
        createdAt:
          type: string
        lastAuthenticatedAt:
          type: object
          nullable: true
        apiKey:
          type: string
          description: Full API key value shown only once at creation time
      required:
        - apiKeyId
        - name
        - expiresAt
        - createdAt
        - lastAuthenticatedAt
        - apiKey
    UpdateProjectMemberApiKeyRequestDto:
      type: object
      properties:
        name:
          type: string
          description: New name for the API key
      required:
        - name
    RequestAccessUserApiDto:
      type: object
      properties:
        userId:
          type: string
        email:
          type: string
      required:
        - userId
        - email
    RequestAccessOrganizationApiDto:
      type: object
      properties:
        name:
          type: string
      required:
        - name
    RequestAccessProjectApiDto:
      type: object
      properties:
        projectId:
          type: string
        projectTitle:
          type: string
      required:
        - projectId
        - projectTitle
    ExistingAccessRequestApiDto:
      type: object
      properties:
        role:
          type: string
          enum:
            - admin
            - editor
            - viewer
        status:
          type: string
      required:
        - role
        - status
    RequestAccessContextApiDto:
      type: object
      properties:
        decision:
          type: string
          enum:
            - request_access
        user:
          $ref: '#/components/schemas/RequestAccessUserApiDto'
        organization:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/RequestAccessOrganizationApiDto'
        project:
          $ref: '#/components/schemas/RequestAccessProjectApiDto'
        availableRoles:
          type: array
          items:
            type: string
            enum:
              - admin
              - editor
              - viewer
        defaultRole:
          type: string
          enum:
            - admin
            - editor
            - viewer
        existingRequest:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/ExistingAccessRequestApiDto'
      required:
        - decision
        - user
        - project
        - availableRoles
        - defaultRole
    RequestProjectAccessApiDto:
      type: object
      properties:
        role:
          type: string
          enum:
            - admin
            - editor
            - viewer
      required:
        - role
    RequestProjectAccessResponseApiDto:
      type: object
      properties:
        userId:
          type: string
        projectId:
          type: string
        projectTitle:
          type: string
        request:
          $ref: '#/components/schemas/ExistingAccessRequestApiDto'
      required:
        - userId
        - projectId
        - projectTitle
        - request
    CreateNewProjectApiDto:
      type: object
      properties:
        integration:
          type: string
          enum:
            - owox-data-marts
            - claude
            - chatgpt
          default: owox-data-marts
    CreateNewProjectResponseApiDto:
      type: object
      properties:
        projectId:
          type: string
        projectTitle:
          type: string
      required:
        - projectId
        - projectTitle
    CredentialDefinitionApiDto:
      type: object
      properties:
        id:
          type: string
        source:
          type: string
          enum:
            - builtin
            - external
        displayName:
          type: string
        description:
          type: string
        documentationUrl:
          type: object
          nullable: true
          format: uri
        secretLabel:
          type: string
        category:
          type: string
          enum:
            - google
            - aws
            - snowflake
            - databricks
            - ai
            - ads
            - social
            - ecommerce
            - currencies
            - custom-connectors
            - other
        connectors:
          type: array
          items:
            type: string
        icon:
          type: string
          enum:
            - google
            - google-cloud
            - google-sheets
            - google-chat
            - aws
            - snowflake
            - databricks
            - openai
            - anthropic
            - gemini
            - openrouter
            - github
          nullable: true
        storageTypes:
          type: array
          items:
            type: string
            enum:
              - GOOGLE_BIGQUERY
              - AWS_ATHENA
              - SNOWFLAKE
              - AWS_REDSHIFT
              - DATABRICKS
              - LEGACY_GOOGLE_BIGQUERY
        destinationTypes:
          type: array
          items:
            type: string
            enum:
              - GOOGLE_SHEETS
              - LOOKER_STUDIO
              - EXCEL
              - EMAIL
              - SLACK
              - MS_TEAMS
              - GOOGLE_CHAT
        auth:
          type: object
          properties:
            type:
              type: string
              enum:
                - header
                - google-service-account
                - fields
                - oauth
                - custom-connector
            fields:
              type: array
              items:
                type: object
                properties:
                  key:
                    type: string
                  label:
                    type: string
                  input:
                    type: string
                    enum:
                      - text
                      - password
                      - multiline
                  secret:
                    type: boolean
                  required:
                    type: boolean
                  identity:
                    type: boolean
            provider:
              type: string
              enum:
                - google
            client:
              type: string
              enum:
                - storage
                - destination
            label:
              type: string
        origins:
          type: array
          items:
            type: string
        supportsAi:
          type: boolean
        ai:
          type: object
          nullable: true
          additionalProperties: true
        compatibilityLine:
          type: object
          nullable: true
      required:
        - id
        - source
        - displayName
        - description
        - secretLabel
        - category
        - connectors
        - icon
        - storageTypes
        - destinationTypes
        - auth
        - origins
        - supportsAi
    GoogleOAuthCredentialSettingsApiDto:
      type: object
      properties:
        available:
          type: boolean
          description: Whether this deployment can connect Google accounts.
        clients:
          type: object
          description: >-
            Whether each OAuth client is configured; a definition names the one
            it uses.
          properties:
            storage:
              type: boolean
            destination:
              type: boolean
      required:
        - available
        - clients
    AuthorizeGoogleOAuthCredentialApiDto:
      type: object
      properties:
        redirectUri:
          type: string
          example: https://app.owox.com/oauth-callback
          description: >-
            Frontend callback URL (must match registered redirect URI in Google
            Console)
        credentialId:
          type: string
          description: Reconnects this Credential instead of creating one.
        definitionId:
          type: string
          default: google-oauth
          description: The Google account definition of the Credential to create.
      required:
        - redirectUri
    GoogleOAuthCredentialAuthorizationApiDto:
      type: object
      properties:
        authorizationUrl:
          type: string
      required:
        - authorizationUrl
    ConnectGoogleOAuthCredentialApiDto:
      type: object
      properties:
        code:
          type: string
          example: 4/0AfJohXk1234567890abcdefghijklmnopqrstuvwxyz
          description: Authorization code from Google OAuth callback
        state:
          type: string
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwcm9qZWN0SWQiOiJ...
          description: State token from authorization URL (CSRF validation)
        title:
          type: string
          description: Used when the Credential is created. Defaults to the account email.
        ownerIds:
          description: Used when the Credential is created.
          type: array
          items:
            type: string
        availableForUse:
          type: boolean
          default: true
          description: Used when the Credential is created.
        availableForMaintenance:
          type: boolean
          default: false
          description: Used when the Credential is created.
      required:
        - code
        - state
    CredentialResponseApiDto:
      type: object
      properties:
        id:
          type: string
        projectId:
          type: string
        title:
          type: string
        definition:
          $ref: '#/components/schemas/CredentialDefinitionApiDto'
        secretConfigured:
          type: boolean
        definitionConsentRequired:
          type: boolean
        enabled:
          type: boolean
        availableForUse:
          type: boolean
        availableForMaintenance:
          type: boolean
        validationState:
          type: string
          enum:
            - unknown
            - verified
            - rejected
        validationMessage:
          type: object
          nullable: true
        validatedAt:
          type: object
          nullable: true
        lastUsedAt:
          type: object
          nullable: true
        aiModelMappings:
          type: object
          additionalProperties:
            type: string
          nullable: true
        aiModelMappingModes:
          type: object
          additionalProperties:
            enum:
              - recommended
              - override
          nullable: true
        publicMetadata:
          description: >-
            Non-secret facts of the stored secret: a Google service account key,
            the non-secret fields of a field set, or a connected Google account.
          nullable: true
          oneOf:
            - type: object
              properties:
                clientEmail:
                  type: string
                projectId:
                  type: string
                privateKeyId:
                  type: string
                clientId:
                  type: string
            - type: object
              properties:
                fields:
                  type: object
                  additionalProperties:
                    type: string
                connection:
                  type: object
                  description: The Google account a Source Credential is signed in with.
                  properties:
                    account:
                      type: object
                      nullable: true
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                          nullable: true
                        email:
                          type: string
                          nullable: true
                    expiresAt:
                      type: string
                      format: date-time
                      nullable: true
            - type: object
              properties:
                account:
                  type: object
                  properties:
                    email:
                      type: string
                    name:
                      type: string
                      nullable: true
                    picture:
                      type: string
                      nullable: true
                scopes:
                  type: array
                  items:
                    type: string
        identity:
          type: object
          nullable: true
          description: >-
            The account the Credential belongs to; null when the definition
            names none.
        setSecretFieldKeys:
          description: >-
            Keys of the secret fields of a field set that hold a value; the
            values are never returned.
          type: array
          items:
            type: string
        canUse:
          type: boolean
          description: Whether the current member may bind this Credential.
        ownerUsers:
          type: array
          items:
            type: object
        contexts:
          type: array
          items:
            $ref: '#/components/schemas/ContextSummaryApiDto'
        usedBy:
          type: array
          items:
            type: object
            properties:
              consumerType:
                type: string
              consumerId:
                type: string
              title:
                type: string
                nullable: true
                description: Null when the member cannot see the consumer.
              requirementKey:
                type: string
              lastUsedAt:
                type: string
                format: date-time
                nullable: true
        createdAt:
          format: date-time
          type: string
        modifiedAt:
          format: date-time
          type: string
      required:
        - id
        - projectId
        - title
        - definition
        - secretConfigured
        - definitionConsentRequired
        - enabled
        - availableForUse
        - availableForMaintenance
        - validationState
        - setSecretFieldKeys
        - canUse
        - ownerUsers
        - contexts
        - usedBy
        - createdAt
        - modifiedAt
    CredentialSecretApiDto:
      type: object
      properties:
        value:
          type: string
          description: Opaque provider secret. Write-only and never returned.
      required:
        - value
    CustomConnectorFieldApiDto:
      type: object
      properties:
        key:
          type: string
        label:
          type: string
        secret:
          type: boolean
        required:
          type: boolean
          description: >-
            Accepted so a requirement field list can be sent as returned; not
            stored.
      required:
        - key
        - label
        - secret
    CustomConnectorInputApiDto:
      type: object
      properties:
        hosts:
          description: Bare hostnames the Credential may be sent to.
          type: array
          items:
            type: string
        fieldList:
          type: array
          items:
            $ref: '#/components/schemas/CustomConnectorFieldApiDto'
        fields:
          type: object
          additionalProperties:
            type: string
          description: A value for every field of the list. Secret values are write-only.
      required:
        - hosts
        - fieldList
        - fields
    CreateCredentialApiDto:
      type: object
      properties:
        title:
          type: string
        definitionId:
          type: string
          description: Built-in id or stable external definition id.
        secret:
          description: Required for every definition except fields auth.
          allOf:
            - $ref: '#/components/schemas/CredentialSecretApiDto'
        fields:
          type: object
          description: >-
            Values for a definition with fields auth, by field key. Secret
            fields are write-only and never returned.
          additionalProperties:
            type: string
            nullable: true
        customConnector:
          description: >-
            Required for the custom connector definition: hosts, field list and
            values.
          allOf:
            - $ref: '#/components/schemas/CustomConnectorInputApiDto'
        ownerIds:
          type: array
          items:
            type: string
        contextIds:
          type: array
          items:
            type: string
        availableForUse:
          type: boolean
          default: true
        availableForMaintenance:
          type: boolean
          default: false
        aiModelMappings:
          type: object
          additionalProperties:
            type: string
        aiModelMappingModes:
          type: object
          additionalProperties:
            enum:
              - recommended
              - override
      required:
        - title
        - definitionId
    UnavailableCredentialResponseApiDto:
      type: object
      properties:
        id:
          type: string
        projectId:
          type: string
        title:
          type: string
        definitionId:
          type: string
        state:
          type: string
          enum:
            - unavailable
        createdAt:
          format: date-time
          type: string
        modifiedAt:
          format: date-time
          type: string
      required:
        - id
        - projectId
        - title
        - definitionId
        - state
        - createdAt
        - modifiedAt
    UpdateCredentialApiDto:
      type: object
      properties:
        title:
          type: string
        secret:
          $ref: '#/components/schemas/CredentialSecretApiDto'
        fields:
          type: object
          description: >-
            Values for a definition with fields auth, by field key. An omitted
            field keeps its value; null clears an optional one. Secret fields
            are write-only and never returned.
          additionalProperties:
            type: string
            nullable: true
        hosts:
          description: 'Refused: hosts are fixed once the Credential is created.'
          type: array
          items:
            type: string
        fieldList:
          description: 'Refused: the field list is fixed once the Credential is created.'
          type: array
          items:
            type: string
        ownerIds:
          type: array
          items:
            type: string
        contextIds:
          type: array
          items:
            type: string
        enabled:
          type: boolean
        availableForUse:
          type: boolean
        availableForMaintenance:
          type: boolean
        aiModelMappings:
          type: object
          additionalProperties:
            type: string
          nullable: true
        aiModelMappingModes:
          type: object
          additionalProperties:
            enum:
              - recommended
              - override
          nullable: true
    StartCredentialSetupApiDto:
      type: object
      properties:
        title:
          type: string
          description: >-
            Suggested name for a new Credential. The user can change it in the
            form.
        definitionId:
          type: string
        credentialId:
          type: string
    CredentialSetupResponseApiDto:
      type: object
      properties:
        id:
          type: string
        mode:
          type: string
          enum:
            - create
            - update
        status:
          type: string
          enum:
            - pending
            - completed
            - cancelled
            - expired
        definitionId:
          type: string
          nullable: true
        credentialId:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        createdAt:
          format: date-time
          type: string
        expiresAt:
          format: date-time
          type: string
        completedAt:
          format: date-time
          type: string
          nullable: true
      required:
        - id
        - mode
        - status
        - definitionId
        - credentialId
        - title
        - createdAt
        - expiresAt
        - completedAt
    CompleteCredentialSetupApiDto:
      type: object
      properties:
        credentialId:
          type: string
      required:
        - credentialId
    ExchangeProjectMemberApiKeyRequestApiDto:
      type: object
      properties:
        apiKeySecret:
          type: string
          example: vjqmM5GfJ6QklV8mFqM5Ior2hK6vK4mY8pE9T7aZr6Q
      required:
        - apiKeySecret
    ExchangeProjectMemberApiKeyResponseApiDto:
      type: object
      properties:
        accessToken:
          type: string
          example: regular-odm-access-token
        accessTokenExpiresIn:
          type: number
          example: 900
      required:
        - accessToken
    IntercomTokenResponseApiDto:
      type: object
      properties:
        token:
          type: string
          example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
      required:
        - token
    AuthContextResponseApiDto:
      type: object
      properties:
        userId:
          type: string
        projectId:
          type: string
        email:
          type: string
          nullable: true
        fullName:
          type: string
          nullable: true
        avatar:
          type: string
          nullable: true
        roles:
          type: array
          items:
            type: string
            enum:
              - admin
              - editor
              - viewer
        projectTitle:
          type: string
          nullable: true
        authFlow:
          type: string
          nullable: true
        apiKeyId:
          type: string
          nullable: true
        pluginId:
          type: string
          nullable: true
        installationId:
          type: string
          nullable: true
        viewOnly:
          type: boolean
          nullable: true
          description: >-
            True when the session is in view-only mode. Mutating API requests
            are rejected server-side; clients may also suppress analytics.
      required:
        - userId
        - projectId
    SearchReportDataMartRefResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        title:
          type: string
          example: Orders
      required:
        - id
        - title
    SearchReportDataDestinationRefResponseApiDto:
      type: object
      properties:
        id:
          type: string
          example: 2f1c5d0a-5678-4b1c-9d2e-fedcba654321
        title:
          type: string
          example: Finance Sheets
        type:
          type: string
          example: GOOGLE_SHEETS
          description: Data destination type
      required:
        - id
        - title
        - type
    SearchReportRefResponseApiDto:
      type: object
      properties:
        dataMart:
          $ref: '#/components/schemas/SearchReportDataMartRefResponseApiDto'
        dataDestination:
          $ref: '#/components/schemas/SearchReportDataDestinationRefResponseApiDto'
      required:
        - dataMart
        - dataDestination
    SearchResultResponseApiDto:
      type: object
      properties:
        entityType:
          type: string
          enum:
            - DATA_MART
            - DATA_STORAGE
            - DATA_DESTINATION
            - REPORT
          example: DATA_MART
        entityId:
          type: string
          example: 9cabc24e-1234-4a5a-8b12-abcdef123456
        title:
          type: string
          example: Revenue by channel
        description:
          type: string
          nullable: true
          example: Monthly revenue split by acquisition channel
        finalScore:
          type: number
          example: 87
          description: Combined relevance score
        kwScore:
          type: number
          example: 70
          description: Keyword match score
        vecScore:
          type: number
          nullable: true
          example: 92
          description: >-
            Vector similarity score; null when no vector score contributed to
            the result
        report:
          description: >-
            Data mart and destination of a REPORT result; absent for other
            entity types
          allOf:
            - $ref: '#/components/schemas/SearchReportRefResponseApiDto'
        url:
          type: string
          example: https://app.owox.com/ui/project-1/data-marts/dm-1/reports?reportId=rep-1
          description: >-
            Canonical direct URL of a REPORT result; absent for other entity
            types
      required:
        - entityType
        - entityId
        - title
        - description
        - finalScore
        - kwScore
        - vecScore
    ProjectSettingsResponseApiDto:
      type: object
      properties:
        description:
          type: string
          nullable: true
      required:
        - description
    UpdateProjectDescriptionApiDto:
      type: object
      properties:
        description:
          type: string
          nullable: true
          minLength: 1
          maxLength: 10000
      required:
        - description
    CreateLicenseKeyRequestDto:
      type: object
      properties:
        name:
          type: string
          description: Human-readable key name
        origin:
          type: string
          description: Public origin of the deployment the key is bound to
          example: https://data-marts.example.com
      required:
        - name
        - origin
    UpdateLicenseKeyRequestDto:
      type: object
      properties:
        name:
          type: string
          description: Human-readable key name
      required:
        - name
    ReceiverInfoApiDto:
      type: object
      properties:
        userId:
          type: string
        email:
          type: string
        displayName:
          type: string
        avatarUrl:
          type: string
        hasNotificationsEnabled:
          type: boolean
      required:
        - userId
        - email
        - hasNotificationsEnabled
    NotificationSettingsItemResponseApiDto:
      type: object
      properties:
        id:
          type: string
        notificationType:
          type: string
          enum:
            - FAILED_RUNS_ALL_DM
            - SUCCESSFUL_RUNS_ALL_DM
        title:
          type: string
        enabled:
          type: boolean
        receivers:
          type: array
          items:
            $ref: '#/components/schemas/ReceiverInfoApiDto'
        webhookUrl:
          type: object
          nullable: true
        groupingDelayCron:
          type: string
        lastRunAt:
          type: object
          nullable: true
        nextRunAt:
          type: object
          nullable: true
        createdAt:
          type: string
        modifiedAt:
          type: string
      required:
        - id
        - notificationType
        - title
        - enabled
        - receivers
        - groupingDelayCron
        - createdAt
        - modifiedAt
    NotificationSettingsResponseApiDto:
      type: object
      properties:
        settings:
          type: array
          items:
            $ref: '#/components/schemas/NotificationSettingsItemResponseApiDto'
      required:
        - settings
    ProjectMemberApiDto:
      type: object
      properties:
        userId:
          type: string
        email:
          type: string
        displayName:
          type: string
        avatarUrl:
          type: string
        role:
          type: string
        hasNotificationsEnabled:
          type: boolean
        isOutbound:
          type: boolean
      required:
        - userId
        - email
        - role
        - hasNotificationsEnabled
        - isOutbound
    ProjectMembersResponseApiDto:
      type: object
      properties:
        members:
          type: array
          items:
            $ref: '#/components/schemas/ProjectMemberApiDto'
      required:
        - members
    UpdateNotificationSettingApiDto:
      type: object
      properties:
        enabled:
          type: boolean
        receivers:
          description: User IDs of receivers
          type: array
          items:
            type: string
        webhookUrl:
          type: object
          nullable: true
        groupingDelayCron:
          type: string
          enum:
            - '*/5 * * * *'
            - '*/15 * * * *'
            - '*/30 * * * *'
            - 0 * * * *
            - 0 */2 * * *
            - 0 */6 * * *
            - 0 */12 * * *
            - 0 0 * * *
          description: Grouping delay cron expression
    PluginCollectionDocumentApiDto:
      type: object
      properties:
        id:
          type: string
        parentId:
          type: string
        document:
          type: object
        createdAt:
          type: string
        updatedAt:
          type: string
      required:
        - id
        - document
        - createdAt
        - updatedAt
    PluginCollectionPageApiDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/PluginCollectionDocumentApiDto'
        nextCursor:
          type: object
          nullable: true
      required:
        - items
        - nextCursor
    PutPluginCollectionDocumentApiDto:
      type: object
      properties:
        document:
          type: object
          description: A JSON value. Do not store credentials, tokens or secrets.
        parentId:
          type: string
          description: Required for entity-bound collections.
      required:
        - document
    AddGithubCredentialDefinitionApiDto:
      type: object
      properties:
        repository:
          type: string
          example: '@owner/repository'
      required:
        - repository
    CredentialFetchRequestApiDto:
      type: object
      properties:
        url:
          type: string
        method:
          type: string
          description: Fetch-compatible HTTP method.
        headers:
          type: object
          additionalProperties:
            type: string
        bodyBase64:
          type: object
          nullable: true
          description: Request body encoded as base64.
      required:
        - url
        - method
    CredentialFetchResponseApiDto:
      type: object
      properties:
        status:
          type: number
        headers:
          type: object
          additionalProperties:
            type: string
        bodyBase64:
          type: string
          description: Provider response body encoded as base64.
      required:
        - status
        - headers
        - bodyBase64
    CredentialAiRequestApiDto:
      type: object
      properties:
        version:
          type: number
          enum:
            - 1
        model:
          type: string
          enum:
            - fast
            - reasoning
            - embedding
        options:
          type: object
          additionalProperties: true
      required:
        - version
        - model
        - options
    StartPluginActionExecutionApiDto:
      type: object
      properties:
        input:
          type: object
          description: >-
            Checked against the action input schema. Absent means null. At most
            256 KiB as JSON.
    StartedPluginActionExecutionApiDto:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - RUNNING
      required:
        - id
        - status
    PluginActionWorkerPluginApiDto:
      type: object
      properties:
        id:
          type: string
        repositoryId:
          type: string
          description: >-
            The GitHub repository id of the plugin, the same on every deployment
            and after a rename or transfer.
      required:
        - id
        - repositoryId
    PluginActionWorkerContextApiDto:
      type: object
      properties:
        executionId:
          type: string
        action:
          type: string
        input:
          type: object
          description: The input the execution was started with.
        trigger:
          type: string
          enum:
            - frontend
            - schedule
        scheduleId:
          type: string
          nullable: true
          description: >-
            The schedule that started the execution; null for a start from the
            plugin page.
        deadlineAt:
          format: date-time
          type: string
        plugin:
          $ref: '#/components/schemas/PluginActionWorkerPluginApiDto'
        pluginVersion:
          type: string
          description: Semver of the release the execution started on.
        installationId:
          type: string
        projectId:
          type: string
        userId:
          type: string
        credentialHandles:
          description: >-
            Handles for the exact Credentials of the plugin's current release,
            and for its AI Credentials when the request sends `capabilities=ai`.
          type: array
          items:
            type: object
      required:
        - executionId
        - action
        - input
        - trigger
        - scheduleId
        - deadlineAt
        - plugin
        - pluginVersion
        - installationId
        - projectId
        - userId
        - credentialHandles
    PluginActionExecutionErrorApiDto:
      type: object
      properties:
        code:
          type: string
          description: >-
            The failure code for FAILED, set by the plugin's backend or by OWOX
            (`BACKEND_*`), or the status for CANCELLED and TIMED_OUT.
        message:
          type: string
      required:
        - code
        - message
    PluginActionExecutionApiDto:
      type: object
      properties:
        id:
          type: string
        action:
          type: string
        status:
          type: string
          enum:
            - QUEUED
            - RUNNING
            - SUCCEEDED
            - FAILED
            - CANCELLED
            - TIMED_OUT
          description: >-
            QUEUED: a scheduled run waits for a start limit; it has no startedAt
            or deadlineAt yet.
        trigger:
          type: string
          enum:
            - frontend
            - schedule
        scheduleId:
          type: string
          nullable: true
          description: >-
            The schedule that started the execution; null for a start from the
            plugin page.
        startedAt:
          format: date-time
          type: string
          nullable: true
        deadlineAt:
          format: date-time
          type: string
          nullable: true
        finishedAt:
          format: date-time
          type: string
          nullable: true
        result:
          type: object
          description: SUCCEEDED only. Cleared 24 hours after the execution ends.
        error:
          nullable: true
          description: FAILED, CANCELLED and TIMED_OUT only.
          type: object
          allOf:
            - $ref: '#/components/schemas/PluginActionExecutionErrorApiDto'
      required:
        - id
        - action
        - status
        - trigger
        - scheduleId
        - startedAt
        - deadlineAt
        - finishedAt
        - result
        - error
    CreatePluginScheduleApiDto:
      type: object
      properties:
        action:
          type: string
          description: A backend action declared by the current version.
        parameters:
          type: object
          description: >-
            Checked against the action input schema. Absent means null. At most
            64 KiB as JSON.
        cron:
          type: string
          maxLength: 255
        timeZone:
          type: string
          maxLength: 64
          description: An IANA time zone, for example Europe/Kyiv.
        enabled:
          type: boolean
          default: true
          description: False creates a Paused schedule.
        name:
          type: string
          maxLength: 200
      required:
        - action
        - cron
        - timeZone
    PluginScheduleLastRunApiDto:
      type: object
      properties:
        executionId:
          type: string
        status:
          type: string
          enum:
            - QUEUED
            - RUNNING
            - SUCCEEDED
            - FAILED
            - CANCELLED
            - TIMED_OUT
        errorCode:
          type: string
          nullable: true
        finishedAt:
          type: string
          format: date-time
          nullable: true
      required:
        - executionId
        - status
        - errorCode
        - finishedAt
    PluginScheduleApiDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          nullable: true
        action:
          type: string
        cron:
          type: string
          description: Five fields, or six with seconds; runs at most once a minute.
        timeZone:
          type: string
          description: The IANA time zone the cron expression is read in.
        enabled:
          type: boolean
          description: False while Paused or Disabled.
        disabledReason:
          type: string
          enum:
            - ACTION_NOT_DECLARED
            - INVALID_PARAMETERS
            - PAUSED_BY_ADMIN
          nullable: true
        nextRunAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            Null while Paused or Disabled, or while the installation is
            uninstalled.
        lastRun:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/PluginScheduleLastRunApiDto'
        createdAt:
          type: string
          format: date-time
        modifiedAt:
          type: string
          format: date-time
        parameters:
          type: object
          description: The input each run starts the action with.
      required:
        - id
        - name
        - action
        - cron
        - timeZone
        - enabled
        - disabledReason
        - nextRunAt
        - lastRun
        - createdAt
        - modifiedAt
        - parameters
    PluginScheduleListApiDto:
      type: object
      properties:
        schedules:
          type: array
          items:
            $ref: '#/components/schemas/PluginScheduleApiDto'
      required:
        - schedules
    UpdatePluginScheduleApiDto:
      type: object
      properties:
        action:
          type: string
        parameters:
          type: object
          description: Replaces the parameters; null clears them.
        cron:
          type: string
          maxLength: 255
        timeZone:
          type: string
          maxLength: 64
        name:
          type: string
          nullable: true
          maxLength: 200
          description: Null clears it.
    PublishPluginApiDto:
      type: object
      properties:
        repository:
          type: string
          description: GitHub repository, as a URL or owner/name.
          example: https://github.com/OWOX/example-plugin
        scope:
          type: string
          enum:
            - deployment
            - project
            - member
          description: Authority level to publish at.
        projectIds:
          description: >-
            Deployment scope only. Projects to add to the audience. Cannot be
            combined with allProjects.
          type: array
          items:
            type: string
        allProjects:
          type: boolean
          description: >-
            Deployment scope only. Every current and future project.
            Indivisible: projects cannot be excluded from it.
      required:
        - repository
        - scope
    ReleaseRejectionApiDto:
      type: object
      properties:
        tagName:
          type: string
        githubReleaseId:
          type: string
          nullable: true
        code:
          type: string
          enum:
            - DRAFT
            - PRERELEASE_FLAG
            - PRERELEASE_TAG
            - BUILD_METADATA_TAG
            - INVALID_TAG
            - COMMIT_UNRESOLVABLE
            - MANIFEST_MISSING
            - MANIFEST_INVALID_JSON
            - MANIFEST_SCHEMA
            - COLLECTIONS_INCOMPATIBLE
            - ACTION_INPUT_UNSUPPORTED
            - ACTIONS_INCOMPATIBLE
            - BACKEND_ORIGIN_CHANGED
            - DELIVERY_UNSUPPORTED
            - URL_NOT_HTTPS
            - URL_PRIVATE_NETWORK
            - URL_UNREACHABLE
            - IFRAME_BLOCKED
            - VERSION_CONFLICT
        detail:
          type: string
          description: Publisher-only detail. Never returned on member-facing routes.
      required:
        - tagName
        - githubReleaseId
        - code
        - detail
    PluginPublisherDiagnosticsApiDto:
      type: object
      properties:
        deliveryUrl:
          type: string
          nullable: true
        commitSha:
          type: string
          nullable: true
        accessMode:
          type: string
          enum:
            - app
            - server-token
            - anonymous
          nullable: true
        syncedAt:
          type: string
          nullable: true
        acceptedSemvers:
          type: array
          items:
            type: string
        unchangedSemvers:
          type: array
          items:
            type: string
        rejections:
          type: array
          items:
            $ref: '#/components/schemas/ReleaseRejectionApiDto'
      required:
        - deliveryUrl
        - commitSha
        - accessMode
        - syncedAt
        - acceptedSemvers
        - unchangedSemvers
        - rejections
    PublicationResponseApiDto:
      type: object
      properties:
        publicationId:
          type: string
        pluginId:
          type: string
        repository:
          type: string
          description: >-
            Canonical owner/name, which is what unpublish takes. Present for
            private repositories too: only the caller who may manage this
            publication ever sees it.
        scope:
          type: string
          enum:
            - deployment
            - project
            - member
        isActive:
          type: boolean
        allProjects:
          type: boolean
          description: Deployment scope only.
        audienceProjectIds:
          description: Active audience; empty unless allProjects is false.
          type: array
          items:
            type: string
        currentSemver:
          type: string
          nullable: true
          description: Current version, if any release is eligible.
        diagnostics:
          description: >-
            Source diagnostics for publishers only. Includes release rejections
            from the last sync.
          allOf:
            - $ref: '#/components/schemas/PluginPublisherDiagnosticsApiDto'
      required:
        - publicationId
        - pluginId
        - repository
        - scope
        - isActive
        - allProjects
        - audienceProjectIds
        - currentSemver
        - diagnostics
    SuspendPluginApiDto:
      type: object
      properties:
        repository:
          type: string
          description: GitHub repository, as a URL or owner/name.
          example: https://github.com/OWOX/example-plugin
        note:
          type: string
          description: Why, for the audit trail. Shown to operators, never to members.
      required:
        - repository
    PluginSuspensionResponseApiDto:
      type: object
      properties:
        pluginId:
          type: string
        suspended:
          type: boolean
          description: >-
            While suspended the plugin cannot be opened, installed or restored.
            Uninstalling and updating stay available, and publications and
            installations are untouched.
        note:
          type: string
          nullable: true
      required:
        - pluginId
        - suspended
        - note
    CheckPluginReleaseApiDto:
      type: object
      properties:
        repository:
          type: string
          description: GitHub repository, as a URL or owner/name.
          example: https://github.com/OWOX/example-plugin
        ref:
          type: string
          description: Branch, tag, or commit SHA to check.
          example: main
        version:
          type: string
          description: >-
            Version the release would carry, X.Y.Z optionally prefixed with v.
            Defaults to the next version after the current one: the next patch
            below 1.0.0, the next minor from 1.0.0.
          example: 1.5.0
      required:
        - repository
        - ref
    PluginReleaseCheckIssueApiDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - DRAFT
            - PRERELEASE_FLAG
            - PRERELEASE_TAG
            - BUILD_METADATA_TAG
            - INVALID_TAG
            - COMMIT_UNRESOLVABLE
            - MANIFEST_MISSING
            - MANIFEST_INVALID_JSON
            - MANIFEST_SCHEMA
            - COLLECTIONS_INCOMPATIBLE
            - ACTION_INPUT_UNSUPPORTED
            - ACTIONS_INCOMPATIBLE
            - BACKEND_ORIGIN_CHANGED
            - DELIVERY_UNSUPPORTED
            - URL_NOT_HTTPS
            - URL_PRIVATE_NETWORK
            - URL_UNREACHABLE
            - IFRAME_BLOCKED
            - VERSION_CONFLICT
        detail:
          type: string
      required:
        - code
        - detail
    PluginReleaseCheckResultApiDto:
      type: object
      properties:
        pluginId:
          type: string
        repository:
          type: string
          description: Canonical owner/name.
        commitSha:
          type: string
          nullable: true
          description: Null when the ref does not resolve.
        candidateVersion:
          type: string
          nullable: true
          description: >-
            Without the v prefix. Null when no version was given and none is
            current.
        baselineVersion:
          type: string
          nullable: true
          description: >-
            Highest recorded version in the candidate's compatibility line. Null
            when there is none or the ref does not resolve; set with
            collectionsEvaluated false when the manifest is invalid.
        collectionsEvaluated:
          type: boolean
          description: Whether collections were compared against the baseline.
        issues:
          description: >-
            Reasons a release from this ref would be rejected; an invalid
            manifest or an unresolvable ref stops evaluation.
          type: array
          items:
            $ref: '#/components/schemas/PluginReleaseCheckIssueApiDto'
      required:
        - pluginId
        - repository
        - commitSha
        - candidateVersion
        - baselineVersion
        - collectionsEvaluated
        - issues
    PluginSourceApiDto:
      type: object
      properties:
        ownerName:
          type: string
          description: GitHub account that owns the repository.
        ownerUrl:
          type: string
        repositoryUrl:
          type: string
          description: Omitted for a private repository, whose name is not disclosed.
      required:
        - ownerName
        - ownerUrl
    InstalledPluginApiDto:
      type: object
      properties:
        pluginId:
          type: string
        displayName:
          type: string
        description:
          type: string
        currentSemver:
          type: string
          nullable: true
          description: Null until a release is eligible.
        currentVersionId:
          type: string
          nullable: true
          description: >-
            Confirm this when installing: two versions can share a SemVer, so
            the number alone is not enough.
        visibleViaScopes:
          type: array
          description: >-
            Why this is visible. Informational: the levels are independent, with
            no precedence.
          items:
            type: string
            enum:
              - deployment
              - project
              - member
        suspended:
          type: boolean
          description: Suspended plugins stay listed but cannot be opened or installed.
        installationState:
          type: string
          enum:
            - not_installed
            - installed
            - uninstalled
        source:
          $ref: '#/components/schemas/PluginSourceApiDto'
        addedAt:
          type: string
          description: >-
            When OWOX first learned of this plugin. The plugin record's own
            date, not the publication's: one more member listing an
            already-known plugin does not make it new.
        nextCheckAt:
          type: string
          nullable: true
          description: >-
            When this deployment checks for a newer version on its own. Null
            while nothing publishes or installs the plugin, which takes it off
            daily maintenance.
        credentialRequirements:
          description: Credentials that must be selected before installation.
          type: array
          items:
            type: object
        backendOrigin:
          type: string
          description: >-
            Origin of the server the current version runs backend actions on.
            Omitted when it declares none.
        installationId:
          type: string
        installedAt:
          format: date-time
          type: string
        uninstalledAt:
          format: date-time
          type: string
          nullable: true
      required:
        - pluginId
        - displayName
        - description
        - currentSemver
        - currentVersionId
        - visibleViaScopes
        - suspended
        - installationState
        - source
        - addedAt
        - nextCheckAt
        - credentialRequirements
        - installationId
        - installedAt
        - uninstalledAt
    PluginEntryApiDto:
      type: object
      properties:
        deliveryUrl:
          type: string
          description: What the sandboxed iframe loads.
        displayName:
          type: string
        pluginId:
          type: string
          description: >-
            Stable plugin identity. Unlike versionId it survives releases,
            renames and transfers, so it is what a plugin may key its own state
            on.
        versionId:
          type: string
        credentialHandles:
          type: array
          items:
            type: object
      required:
        - deliveryUrl
        - displayName
        - pluginId
        - versionId
        - credentialHandles
    PluginCredentialSelectionsApiDto:
      type: object
      properties:
        credentialSelections:
          type: object
          additionalProperties:
            type: string
          description: >-
            Credential requirement handle to the project Credential id granted
            now. An ungranted requirement is absent.
      required:
        - credentialSelections
    PluginRuntimeTokenApiDto:
      type: object
      properties:
        runtimeToken:
          type: string
          description: Installation-bound OWOX access token held by the Plugin Host.
        expiresIn:
          type: number
          description: Access token lifetime in seconds.
      required:
        - runtimeToken
        - expiresIn
    InstallPluginApiDto:
      type: object
      properties:
        expectedVersionId:
          type: string
          nullable: true
          description: >-
            The version the member was shown. Any installed member can move the
            plugin forward, so a mismatch means the confirmation screen is out
            of date.
        credentialSelections:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: Credential requirement handle to selected project Credential id.
      required:
        - expectedVersionId
    PluginInstallationApiDto:
      type: object
      properties:
        installationId:
          type: string
        pluginId:
          type: string
        createdAt:
          format: date-time
          type: string
          description: First ever installation. Survives every uninstall and restore.
        installedAt:
          format: date-time
          type: string
          description: Most recent installation or restoration.
        uninstalledAt:
          format: date-time
          type: string
          nullable: true
      required:
        - installationId
        - pluginId
        - createdAt
        - installedAt
        - uninstalledAt
    UpdatePluginByRepositoryApiDto:
      type: object
      properties:
        repository:
          type: string
          description: GitHub repository, as a URL or owner/name.
          example: https://github.com/OWOX/example-plugin
      required:
        - repository
    PluginUpdateResultApiDto:
      type: object
      properties:
        pluginId:
          type: string
        repository:
          type: string
          description: >-
            Canonical owner/name after resolution. For a private repository the
            name is withheld from anyone but a deployment publisher, as
            `owner/***`, matching what the plugin view discloses.
        currentVersionId:
          type: string
          nullable: true
        currentSemver:
          type: string
          nullable: true
        outcome:
          type: string
          enum:
            - updated
            - up_to_date
            - already_running
            - failed
          description: >-
            What the managed check did. A failure leaves the current version
            active and the daily schedule untouched.
        updated:
          type: boolean
          description: >-
            False when nothing newer was found, which is a normal outcome rather
            than a failure.
        nextCheckAt:
          type: string
          nullable: true
          description: >-
            When this deployment checks again on its own. Asking now does not
            move it.
        diagnostics:
          nullable: true
          description: >-
            Present only for deployment publishers. Release rejections and
            source diagnostics stay off the ordinary member path.
          type: object
          allOf:
            - $ref: '#/components/schemas/PluginPublisherDiagnosticsApiDto'
      required:
        - pluginId
        - repository
        - currentVersionId
        - currentSemver
        - outcome
        - updated
        - nextCheckAt
    PluginHistoryPluginApiDto:
      type: object
      properties:
        pluginId:
          type: string
        displayName:
          type: string
        ownerName:
          type: string
      required:
        - pluginId
        - displayName
        - ownerName
    PluginHistoryActorApiDto:
      type: object
      properties:
        kind:
          type: string
          enum:
            - you
            - member
            - deployment
        name:
          type: string
          description: Set for kind member only.
      required:
        - kind
    PluginHistoryEventApiDto:
      type: object
      properties:
        id:
          type: string
        occurredAt:
          type: string
          format: date-time
        action:
          type: string
          enum:
            - publish
            - unpublish
            - install
            - restore
            - uninstall
            - update
            - suspend
            - resume
        scope:
          type: string
          enum:
            - deployment
            - project
            - member
          nullable: true
          description: Set for publish and unpublish only.
        plugin:
          $ref: '#/components/schemas/PluginHistoryPluginApiDto'
        actor:
          nullable: true
          description: >-
            Null when the actor is not disclosed: an automatic update, or
            someone outside this project.
          type: object
          allOf:
            - $ref: '#/components/schemas/PluginHistoryActorApiDto'
        version:
          type: string
          nullable: true
          description: The version an update made current.
      required:
        - id
        - occurredAt
        - action
        - scope
        - plugin
        - actor
        - version
    PluginHistoryPageApiDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/PluginHistoryEventApiDto'
        nextCursor:
          type: string
          nullable: true
      required:
        - items
        - nextCursor
    ProjectPluginScheduleApiDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          nullable: true
        action:
          type: string
        cron:
          type: string
          description: Five fields, or six with seconds; runs at most once a minute.
        timeZone:
          type: string
          description: The IANA time zone the cron expression is read in.
        enabled:
          type: boolean
          description: False while Paused or Disabled.
        disabledReason:
          type: string
          enum:
            - ACTION_NOT_DECLARED
            - INVALID_PARAMETERS
            - PAUSED_BY_ADMIN
          nullable: true
        nextRunAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            Null while Paused or Disabled, or while the installation is
            uninstalled.
        lastRun:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/PluginScheduleLastRunApiDto'
        createdAt:
          type: string
          format: date-time
        modifiedAt:
          type: string
          format: date-time
        pluginId:
          type: string
        pluginName:
          type: string
          description: The current version's display name.
        installationId:
          type: string
        installationState:
          type: string
          enum:
            - installed
            - uninstalled
        owner:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
        ownerIsMember:
          type: boolean
          nullable: true
          description: >-
            False while the owner is not an active project member: the schedule
            skips its runs. Null when the check failed.
        canManage:
          type: boolean
          description: True for the installation owner and for a project admin.
      required:
        - id
        - name
        - action
        - cron
        - timeZone
        - enabled
        - disabledReason
        - nextRunAt
        - lastRun
        - createdAt
        - modifiedAt
        - pluginId
        - pluginName
        - installationId
        - installationState
        - owner
        - ownerIsMember
        - canManage
    ProjectPluginScheduleListApiDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ProjectPluginScheduleApiDto'
        total:
          type: number
      required:
        - items
        - total
    PluginRunApiDto:
      type: object
      properties:
        id:
          type: string
        pluginId:
          type: string
        pluginName:
          type: string
          description: The current version's display name.
        pluginVersion:
          type: string
          nullable: true
          description: The semver the run used.
        action:
          type: string
        status:
          type: string
          enum:
            - QUEUED
            - RUNNING
            - SUCCEEDED
            - FAILED
            - CANCELLED
            - TIMED_OUT
        trigger:
          type: string
          enum:
            - frontend
            - schedule
        scheduleId:
          type: string
          nullable: true
        scheduleName:
          type: string
          nullable: true
          description: Null once the schedule is deleted.
        owner:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/UserProjectionDto'
        createdAt:
          type: string
          format: date-time
        queuedAt:
          type: string
          format: date-time
          nullable: true
        startedAt:
          type: string
          format: date-time
          nullable: true
        finishedAt:
          type: string
          format: date-time
          nullable: true
        timeLimitSeconds:
          type: number
          nullable: true
          description: Null before the run starts.
        errorCode:
          type: string
          nullable: true
        errorMessage:
          type: string
          nullable: true
        errorMessageCleared:
          type: boolean
          description: True once the 24-hour sweep cleared the plugin's own message.
        canCancel:
          type: boolean
          description: True for the owner or a project admin while Queued or Running.
      required:
        - id
        - pluginId
        - pluginName
        - pluginVersion
        - action
        - status
        - trigger
        - scheduleId
        - scheduleName
        - owner
        - createdAt
        - queuedAt
        - startedAt
        - finishedAt
        - timeLimitSeconds
        - errorCode
        - errorMessage
        - errorMessageCleared
        - canCancel
    PluginRunListApiDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/PluginRunApiDto'
        nextCursor:
          type: string
          nullable: true
      required:
        - items
        - nextCursor
    PluginGalleryEntryApiDto:
      type: object
      properties:
        pluginId:
          type: string
        displayName:
          type: string
        description:
          type: string
        currentSemver:
          type: string
          nullable: true
          description: Null until a release is eligible.
        currentVersionId:
          type: string
          nullable: true
          description: >-
            Confirm this when installing: two versions can share a SemVer, so
            the number alone is not enough.
        visibleViaScopes:
          type: array
          description: >-
            Why this is visible. Informational: the levels are independent, with
            no precedence.
          items:
            type: string
            enum:
              - deployment
              - project
              - member
        suspended:
          type: boolean
          description: Suspended plugins stay listed but cannot be opened or installed.
        installationState:
          type: string
          enum:
            - not_installed
            - installed
            - uninstalled
        source:
          $ref: '#/components/schemas/PluginSourceApiDto'
        addedAt:
          type: string
          description: >-
            When OWOX first learned of this plugin. The plugin record's own
            date, not the publication's: one more member listing an
            already-known plugin does not make it new.
        nextCheckAt:
          type: string
          nullable: true
          description: >-
            When this deployment checks for a newer version on its own. Null
            while nothing publishes or installs the plugin, which takes it off
            daily maintenance.
        credentialRequirements:
          description: Credentials that must be selected before installation.
          type: array
          items:
            type: object
        backendOrigin:
          type: string
          description: >-
            Origin of the server the current version runs backend actions on.
            Omitted when it declares none.
      required:
        - pluginId
        - displayName
        - description
        - currentSemver
        - currentVersionId
        - visibleViaScopes
        - suspended
        - installationState
        - source
        - addedAt
        - nextCheckAt
        - credentialRequirements
    PluginLookupApiDto:
      type: object
      properties:
        pluginId:
          type: string
          description: The plugin id in this deployment.
      required:
        - pluginId
