openapi: 3.1.0
info:
  title: tripl
  description: Analytics tracking plan service
  version: 0.1.0
paths:
  /api/v1/auth/status:
    get:
      tags:
        - auth
      summary: Get Status
      operationId: get_status_api_v1_auth_status_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthStatusResponse'
  /api/v1/auth/register:
    post:
      tags:
        - auth
      summary: Register
      description: >-
        Self-service sign-up.


        Self-hosted: into the default organization (the first account owns it
        and

        is a platform admin); ``org_name`` / ``org_slug`` are ignored.


        Hosted: ``org_name`` and ``org_slug`` are required and the account
        creates

        and owns that organization. It starts unverified — the verification link

        is mailed through the operator relay after the commit (a failed send is

        logged; the user can resend) — so 503 up front when that relay cannot
        send.
      operationId: register_api_v1_auth_register_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthUserResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/invitations/{token}:
    get:
      tags:
        - auth
      summary: Preview Invitation
      description: >-
        Show who an invitation is for, before the invitee has an account.


        Unauthenticated by necessity — the whole point is that this person
        cannot

        sign in yet. It discloses nothing the token holder does not already
        have:

        the address it was issued to, the organization role it grants, and when
        it lapses. It

        does not reveal whether the instance has other users, or who they are.


        Shares the cheap /status bucket rather than the register bucket:
        previewing

        is a read, and it must not consume the quota the invitee needs to
        actually

        redeem. Unknown, expired and used tokens all return the same 400.
      operationId: preview_invitation_api_v1_auth_invitations__token__get
      parameters:
        - name: token
          in: path
          required: true
          schema:
            type: string
            title: Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvitationPreview'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/invitations/{token}/accept:
    post:
      tags:
        - auth
      summary: Accept Invitation
      description: >-
        Redeem an invitation: into a new account, or into the signed-in one.


        Signed in (a browser session cookie): the invitation adds a membership
        of

        its organization to THIS account, but only when the account's email is
        the

        invitation's (case-insensitive) — else 403 and the invitation stays
        unused;

        on a hosted instance the account must also have verified its address
        (403);

        409 when the account is already a member. Answers 200 and leaves the

        session as it is (F20 PR6).


        Not signed in: the new-account path. ``password`` is required, the
        account

        is created with the invitation's address and the new user is signed

        straight in (201). Self-hosted the account counts as email-verified.
        Hosted

        it starts unverified — the inviter was handed the raw link, so redeeming
        it

        proves nothing about the address — and a verification link is mailed

        through the operator relay after the commit (a failed send is logged;
        the

        user can resend).

        Reachable regardless of ``registration_mode`` —

        an owner-issued, single-use, expiring, address-bound invitation is a

        different mechanism from the instance-wide door, so a closed instance
        can

        still onboard exactly the people its owner named.


        On the register rate-limit bucket, so guessing tokens costs the same as

        hammering signup.


        Public demos require an already signed-in, verified account matching the

        invitation. Anonymous password redemption is refused with 403, without

        creating an account or sending verification mail. Acceptance grants the

        member organization role and viewer access to its existing ready demos;

        existing project grants are preserved. A full demo organization returns
        409.
      operationId: accept_invitation_api_v1_auth_invitations__token__accept_post
      parameters:
        - name: token
          in: path
          required: true
          schema:
            type: string
            title: Token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvitationAcceptRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthUserResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/login:
    post:
      tags:
        - auth
      summary: Login
      operationId: login_api_v1_auth_login_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthUserResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/password-reset/request:
    post:
      tags:
        - auth
      summary: Request Password Reset
      operationId: request_password_reset_api_v1_auth_password_reset_request_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PasswordResetRequestBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PasswordResetRequestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/password-reset/confirm:
    post:
      tags:
        - auth
      summary: Confirm Password Reset
      operationId: confirm_password_reset_api_v1_auth_password_reset_confirm_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PasswordResetConfirmBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PasswordResetConfirmResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/verify-email/request:
    post:
      tags:
        - auth
      summary: Request Email Verification
      description: >-
        Mail the signed-in account a fresh verification link (a resend).


        A browser session only (an API key is 403). 204 without doing anything

        when the address is already verified or the instance does not require

        verification (self-hosted); 503 when the operator relay cannot send.

        Otherwise every earlier link of the account stops working and the new
        one

        goes out after the response (a failed send is logged).
      operationId: request_email_verification_api_v1_auth_verify_email_request_post
      responses:
        '204':
          description: Successful Response
  /api/v1/auth/verify-email/confirm:
    post:
      tags:
        - auth
      summary: Confirm Email Verification
      description: >-
        Redeem a verification link, signed in as the account it was issued to.


        Needs a browser session (401 without one): the link alone proves only
        that

        someone read the mail, the session proves it is the account holder who

        did. A session of a different account gets the same 400 as an unknown,

        expired or used token, and the token stays usable. On success every
        other

        session of the account is signed out, and on a hosted instance an
        address

        listed in ``PLATFORM_ADMIN_EMAILS`` becomes a platform admin — the only

        place that grant happens. On the login bucket, like the password reset

        confirm, so guessing tokens costs what guessing passwords does.
      operationId: confirm_email_verification_api_v1_auth_verify_email_confirm_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyEmailConfirmRequest'
        required: true
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/logout:
    post:
      tags:
        - auth
      summary: Logout
      operationId: logout_api_v1_auth_logout_post
      responses:
        '204':
          description: Successful Response
  /api/v1/auth/me:
    get:
      tags:
        - auth
      summary: Get Me
      description: >-
        The signed-in account with its organization role(s) and the
        platform-admin flag.


        For an API key it also names the key's organization (``org``) and scope

        (``api_key_scope``): what ``tripl whoami`` prints. Read from the
        database on

        every call, so a membership added, changed or removed shows at once.
      operationId: get_me_api_v1_auth_me_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthUserResponse'
  /api/v1/auth/google/start:
    get:
      tags:
        - auth
      summary: Start
      description: Send the browser to Google's account chooser.
      operationId: start_api_v1_auth_google_start_get
      parameters:
        - name: next
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 2048
              - type: 'null'
            title: Next
      responses:
        '302':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/google/callback:
    get:
      tags:
        - auth
      summary: Callback
      description: 'Google''s redirect back: signed in and into the app, or back to sign-in.'
      operationId: callback_api_v1_auth_google_callback_get
      parameters:
        - name: code
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 4096
              - type: 'null'
            title: Code
        - name: state
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 512
              - type: 'null'
            title: State
        - name: error
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 256
              - type: 'null'
            title: Error
      responses:
        '302':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/oidc/start:
    get:
      tags:
        - auth
      summary: Start
      description: Send the browser to the instance's OpenID Connect provider.
      operationId: start_api_v1_auth_oidc_start_get
      parameters:
        - name: next
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 2048
              - type: 'null'
            title: Next
      responses:
        '302':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/auth/oidc/callback:
    get:
      tags:
        - auth
      summary: Callback
      description: >-
        The provider's redirect back: signed in and into the app, or back to
        sign-in.
      operationId: callback_api_v1_auth_oidc_callback_get
      parameters:
        - name: code
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 4096
              - type: 'null'
            title: Code
        - name: state
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 512
              - type: 'null'
            title: State
        - name: error
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 256
              - type: 'null'
            title: Error
      responses:
        '302':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/activity:
    get:
      tags:
        - activity
      summary: List Workspace Activity
      description: >-
        The workspace rail: activity from the projects the caller is a member
        of.
      operationId: list_workspace_activity_api_v1_activity_get
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ActivityItemResponse'
                title: Response List Workspace Activity Api V1 Activity Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/activity/projects/{slug}:
    get:
      tags:
        - activity
      summary: List Project Activity
      description: One project's rail; a non-member gets "Project not found".
      operationId: list_project_activity_api_v1_activity_projects__slug__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ActivityItemResponse'
                title: >-
                  Response List Project Activity Api V1 Activity Projects  Slug 
                  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/ai/status:
    get:
      tags:
        - ai
      summary: Ai Status
      operationId: ai_status_api_v1_projects__slug__ai_status_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiStatusResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/ai/describe-event:
    post:
      tags:
        - ai
      summary: Describe Event
      operationId: describe_event_api_v1_projects__slug__ai_describe_event_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AiDescribeEventRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiDescribeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/ai/describe-event-type:
    post:
      tags:
        - ai
      summary: Describe Event Type
      operationId: describe_event_type_api_v1_projects__slug__ai_describe_event_type_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AiDescribeEventTypeRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiDescribeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/ai/ask:
    post:
      tags:
        - ai
      summary: Ask Plan
      operationId: ask_plan_api_v1_projects__slug__ai_ask_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AiAskRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiAskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/settings:
    get:
      tags:
        - settings
      summary: Get Service Settings
      operationId: get_service_settings_api_v1_settings_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CombinedSettingsResponse'
    put:
      tags:
        - settings
      summary: Put Service Settings
      description: >-
        Upsert service overrides. Intentionally identical to PATCH: unset fields

        are left untouched (partial update), not reset. Kept as a stable alias
        for

        clients that issue PUT; settings are a sparse override map with no full

        "replace all" semantics.
      operationId: put_service_settings_api_v1_settings_put
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceSettingsUpdate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CombinedSettingsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - settings
      summary: Patch Service Settings
      operationId: patch_service_settings_api_v1_settings_patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceSettingsUpdate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CombinedSettingsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/settings/photo-limits:
    get:
      tags:
        - settings
      summary: Get Photo Limits
      description: >-
        The photo upload limits, readable by every signed-in user.


        The rest of this router is for settings admins; these values are not,
        because it is

        an editor's upload they refuse and the browser should say so before the

        upload rather than after. The caller's organization's limits

        (F20 PR11), resolved like the rest of the legacy route; the operator's
        when

        it resolves none. ``/orgs/{org}/settings/photo-limits`` names one.
      operationId: get_photo_limits_api_v1_settings_photo_limits_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhotoLimitsResponse'
  /api/v1/settings/row-limits:
    get:
      tags:
        - settings
      summary: Get Row Limit Defaults
      description: >-
        The instance row caps a scan falls back to, readable by every signed-in
        user.


        Admin-only like the rest of this router would hide the real numbers from
        the

        editors who fill in a scan's Limits, so the form hard-coded the shipped

        defaults instead. Two integers, nothing about the connection.


        The caller's organization's caps (F20 PR9), resolved like the rest of
        the

        legacy route; ``/orgs/{org}/settings/row-limits`` names one explicitly.
      operationId: get_row_limit_defaults_api_v1_settings_row_limits_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RowLimitDefaultsResponse'
  /api/v1/settings/ai/defaults:
    get:
      tags:
        - settings
      summary: Get Ai Prompt Defaults
      description: The built-in AI system prompts, for each prompt's "Restore default".
      operationId: get_ai_prompt_defaults_api_v1_settings_ai_defaults_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiPromptDefaultsResponse'
  /api/v1/settings/ai:
    get:
      tags:
        - settings
      summary: Get Ai Settings
      operationId: get_ai_settings_api_v1_settings_ai_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiSettingsResponse'
  /api/v1/settings/ai/test:
    post:
      tags:
        - settings
      summary: Test Ai Settings
      operationId: test_ai_settings_api_v1_settings_ai_test_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AiSettingsTestRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SettingsTestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/settings/email/test:
    post:
      tags:
        - settings
      summary: Test Email Settings
      description: >-
        Send one probe message with the saved SMTP settings and report what
        happened.


        Always 200: a relay refusing us is the answer the caller asked for, not
        a

        server fault — the same reasoning the alert-destination test states.
      operationId: test_email_settings_api_v1_settings_email_test_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailSettingsTestRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SettingsTestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects:
    get:
      tags:
        - projects
      summary: List Projects
      operationId: list_projects_api_v1_projects_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ProjectResponse'
                type: array
                title: Response List Projects Api V1 Projects Get
    post:
      tags:
        - projects
      summary: Create Project
      operationId: create_project_api_v1_projects_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/demo:
    post:
      tags:
        - projects
      summary: Create Demo Project
      description: >-
        Start a demo: the response is its ``seeding`` shell; the worker seeds
        it.


        Poll ``GET /projects/{slug}`` until ``generation_status`` reads
        ``ready``

        (or ``failed``). The ``project.create`` audit row is filed by the worker

        once the demo is ready, so a cancelled or failed demo leaves none.
      operationId: create_demo_project_api_v1_projects_demo_post
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectResponse'
  /api/v1/projects/demo/cancel:
    post:
      tags:
        - projects
      summary: Cancel Demo Provisioning
      description: >-
        Abandon this user's in-flight demo provision, if one is still seeding.


        Deliberately ungated by the kill switch: it only ever removes work.
        Declared

        before ``/demo/{slug}/reset`` so the literal path is never shadowed.
      operationId: cancel_demo_provisioning_api_v1_projects_demo_cancel_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoCancelResponse'
  /api/v1/projects/demo/{slug}/reset:
    post:
      tags:
        - projects
      summary: Reset Demo Project
      description: Re-seed a demo in place. Restricted to the demo's creator or an owner.
      operationId: reset_demo_project_api_v1_projects_demo__slug__reset_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/demo/{slug}:
    delete:
      tags:
        - projects
      summary: Delete Demo Project
      description: Delete a demo and its owned synthetic warehouse. Creator or owner only.
      operationId: delete_demo_project_api_v1_projects_demo__slug__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}:
    get:
      tags:
        - projects
      summary: Get Project
      operationId: get_project_api_v1_projects__slug__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - projects
      summary: Update Project
      operationId: update_project_api_v1_projects__slug__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - projects
      summary: Delete Project
      operationId: delete_project_api_v1_projects__slug__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/danger/reset-anomalies:
    post:
      tags:
        - projects
      summary: Reset Anomalies
      description: >-
        Owner-only: clear every anomaly (+ breakdown) in the project's period.


        Destructive and irreversible. Derived monitoring signals disappear with
        the

        anomalies they are computed from. ``dry_run`` only counts.
      operationId: reset_anomalies_api_v1_projects__slug__danger_reset_anomalies_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DetectionResetPeriod'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnomalyResetCounts'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/danger/reset-drifts:
    post:
      tags:
        - projects
      summary: Reset Drifts
      description: >-
        Owner-only: clear every schema + distribution drift in the project's
        period.


        Destructive and irreversible. ``dry_run`` only counts.
      operationId: reset_drifts_api_v1_projects__slug__danger_reset_drifts_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DetectionResetPeriod'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DriftResetCounts'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/danger/retire-unused-variables:
    post:
      tags:
        - projects
      summary: Retire Unused Variables
      description: >-
        Owner-only: drop the variables a scan minted that nothing refers to.


        A scan creates a variable for every placeholder it discovers and has
        never

        retired one, so a project whose warehouse holds a JSON column keyed by

        user-typed text accumulates a row per key forever. This deletes

        only rows that a scan created, no human has edited, no event field value

        names, and that carry no observed context, drift or override — see

        ``core.variable_retirement`` for why "no observed context" alone is not

        enough to be safe.


        ``dry_run`` defaults to true, so the first call is always a preview. It

        returns the same counts the real pass would, broken down by why each

        surviving row was kept.
      operationId: >-
        retire_unused_variables_api_v1_projects__slug__danger_retire_unused_variables_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableRetirementRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableRetirementCounts'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/anomaly-settings:
    get:
      tags:
        - anomaly-settings
      summary: Get Project Anomaly Settings
      operationId: get_project_anomaly_settings_api_v1_projects__slug__anomaly_settings_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectAnomalySettingsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - anomaly-settings
      summary: Update Project Anomaly Settings
      operationId: >-
        update_project_anomaly_settings_api_v1_projects__slug__anomaly_settings_patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectAnomalySettingsUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectAnomalySettingsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/anomaly-settings/holiday-countries:
    get:
      tags:
        - anomaly-settings
      summary: List Holiday Countries
      description: ISO 3166-1 alpha-2 codes ``holiday_country`` accepts (F18).
      operationId: >-
        list_holiday_countries_api_v1_projects__slug__anomaly_settings_holiday_countries_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                title: >-
                  Response List Holiday Countries Api V1 Projects  Slug  Anomaly
                  Settings Holiday Countries Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/anomaly-settings/scope-overrides:
    get:
      tags:
        - anomaly-settings
      summary: List Anomaly Scope Overrides
      operationId: >-
        list_anomaly_scope_overrides_api_v1_projects__slug__anomaly_settings_scope_overrides_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnomalyScopeOverrideListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/anomaly-settings/scope-overrides/{override_id}:
    delete:
      tags:
        - anomaly-settings
      summary: Delete Anomaly Scope Override
      description: >-
        Undo one false-positive ratchet: the scope returns to the project
        setting.
      operationId: >-
        delete_anomaly_scope_override_api_v1_projects__slug__anomaly_settings_scope_overrides__override_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: override_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Override Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branch-settings:
    get:
      tags:
        - branch-settings
      summary: Get Project Branch Settings
      operationId: get_project_branch_settings_api_v1_projects__slug__branch_settings_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectBranchSettingsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - branch-settings
      summary: Update Project Branch Settings
      description: >-
        Owner-only: min_approvals/block_self_approval govern what editors may

        merge, so editors must not be able to loosen the policy on themselves.


        This protects the merge POLICY, not the plan: editors can still manage

        event-type owners and write ``main`` directly, so the owner-approval
        gate

        is a branch-review convention rather than an access control

        .
      operationId: >-
        update_project_branch_settings_api_v1_projects__slug__branch_settings_patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectBranchSettingsUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectBranchSettingsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/members:
    get:
      tags:
        - project-members
      summary: List Members
      operationId: list_members_api_v1_projects__slug__members_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProjectMemberResponse'
                title: Response List Members Api V1 Projects  Slug  Members Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - project-members
      summary: Add Member
      operationId: add_member_api_v1_projects__slug__members_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectMemberCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectMemberResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/members/{user_id}:
    patch:
      tags:
        - project-members
      summary: Update Member
      operationId: update_member_api_v1_projects__slug__members__user_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectMemberUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectMemberResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - project-members
      summary: Remove Member
      operationId: remove_member_api_v1_projects__slug__members__user_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/project-templates:
    get:
      tags:
        - project-templates
      summary: List Project Templates
      operationId: list_project_templates_api_v1_project_templates_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ProjectTemplateSummary'
                type: array
                title: Response List Project Templates Api V1 Project Templates Get
  /api/v1/projects/{slug}/tracker-config:
    get:
      tags:
        - tracker-config
      summary: Get Project Tracker Config
      operationId: get_project_tracker_config_api_v1_projects__slug__tracker_config_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectTrackerConfigResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - tracker-config
      summary: Update Project Tracker Config
      description: >-
        Owner-only: the tracker config stores an API token and drives outbound

        ticket creation, so editors must not be able to point it at their own
        Jira.
      operationId: >-
        update_project_tracker_config_api_v1_projects__slug__tracker_config_patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectTrackerConfigUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectTrackerConfigResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-destinations:
    get:
      tags:
        - alerting
      summary: List Alert Destinations
      operationId: list_alert_destinations_api_v1_projects__slug__alert_destinations_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AlertDestinationResponse'
                title: >-
                  Response List Alert Destinations Api V1 Projects  Slug  Alert
                  Destinations Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - alerting
      summary: Create Alert Destination
      operationId: create_alert_destination_api_v1_projects__slug__alert_destinations_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertDestinationCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertDestinationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/monitors-summary:
    get:
      tags:
        - alerting
      summary: Get Monitors Summary
      operationId: get_monitors_summary_api_v1_projects__slug__monitors_summary_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorsSummaryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-destinations/{destination_id}:
    get:
      tags:
        - alerting
      summary: Get Alert Destination
      operationId: >-
        get_alert_destination_api_v1_projects__slug__alert_destinations__destination_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: destination_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Destination Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertDestinationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - alerting
      summary: Update Alert Destination
      operationId: >-
        update_alert_destination_api_v1_projects__slug__alert_destinations__destination_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: destination_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Destination Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertDestinationUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertDestinationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - alerting
      summary: Delete Alert Destination
      operationId: >-
        delete_alert_destination_api_v1_projects__slug__alert_destinations__destination_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: destination_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Destination Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-destinations/test:
    post:
      tags:
        - alerting
      summary: Test Alert Destination Draft
      description: |-
        Send the test message through settings that are not saved yet.

        The destination dialog's "Send test": an unsaved destination, or an edit
        in progress, where ``destination_id`` lends the stored secrets the form
        left blank. Same contract as the saved destination's Test — editor-only,
        always 200 with ``ok``/``error`` — and the same audit action, so "who
        pressed Test" has one place to look whichever button it was.
      operationId: >-
        test_alert_destination_draft_api_v1_projects__slug__alert_destinations_test_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertDestinationDraftTestRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertDestinationTestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-destinations/{destination_id}/test:
    post:
      tags:
        - alerting
      summary: Test Alert Destination
      description: >-
        Send one fixed test message through this destination's real channel.


        Editor-only: it puts a message in somebody's Slack/Telegram/inbox and,
        for a

        tracker destination, opens a ticket. Always 200 — a channel refusal is
        the

        answer the caller asked for, not a server fault (see

        ``AlertDestinationTestResponse``).


        Recorded in the audit log rather than as an AlertDelivery, so the
        Delivery

        log keeps meaning "an alert fired"; see
        ``services/_alerting_test_send``.
      operationId: >-
        test_alert_destination_api_v1_projects__slug__alert_destinations__destination_id__test_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: destination_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Destination Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertDestinationTestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-destinations/{destination_id}/rules:
    post:
      tags:
        - alerting
      summary: Create Alert Rule
      operationId: >-
        create_alert_rule_api_v1_projects__slug__alert_destinations__destination_id__rules_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: destination_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Destination Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertRuleCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertRuleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-destinations/{destination_id}/rules/{rule_id}:
    patch:
      tags:
        - alerting
      summary: Update Alert Rule
      operationId: >-
        update_alert_rule_api_v1_projects__slug__alert_destinations__destination_id__rules__rule_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: destination_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Destination Id
        - name: rule_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Rule Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertRuleUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertRuleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - alerting
      summary: Delete Alert Rule
      operationId: >-
        delete_alert_rule_api_v1_projects__slug__alert_destinations__destination_id__rules__rule_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: destination_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Destination Id
        - name: rule_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Rule Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-destinations/{destination_id}/rules/{rule_id}/simulate:
    post:
      tags:
        - alerting
      summary: Simulate Alert Rule
      operationId: >-
        simulate_alert_rule_api_v1_projects__slug__alert_destinations__destination_id__rules__rule_id__simulate_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: destination_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Destination Id
        - name: rule_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Rule Id
        - name: days
          in: query
          required: false
          schema:
            type: integer
            maximum: 90
            minimum: 1
            default: 7
            title: Days
        - name: cooldown_minutes_override
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 10080
                minimum: 0
              - type: 'null'
            title: Cooldown Minutes Override
        - name: min_percent_delta_override
          in: query
          required: false
          schema:
            anyOf:
              - type: number
                minimum: 0
              - type: 'null'
            title: Min Percent Delta Override
        - name: min_expected_count_override
          in: query
          required: false
          schema:
            anyOf:
              - type: number
                minimum: 0
              - type: 'null'
            title: Min Expected Count Override
        - name: sigma_threshold_override
          in: query
          required: false
          schema:
            anyOf:
              - type: number
                maximum: 10
                exclusiveMinimum: 0
              - type: 'null'
            title: Sigma Threshold Override
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/AlertRuleUpdate'
                - type: 'null'
              title: Draft
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertRuleSimulateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-deliveries:
    get:
      tags:
        - alerting
      summary: List Alert Deliveries
      operationId: list_alert_deliveries_api_v1_projects__slug__alert_deliveries_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/AlertDeliveryStatus'
              - type: 'null'
            title: Status
        - name: channel
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/AlertDestinationType'
              - type: 'null'
            title: Channel
        - name: destination_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Destination Id
        - name: rule_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Rule Id
        - name: scan_config_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Scan Config Id
        - name: correlation_group_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Correlation Group Id
        - name: ungrouped
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Ungrouped
        - name: date_from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Date From
        - name: date_to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Date To
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 50
            title: Limit
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 512
              - type: 'null'
            title: Cursor
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertDeliveryListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-deliveries/{delivery_id}:
    get:
      tags:
        - alerting
      summary: Get Alert Delivery
      operationId: >-
        get_alert_delivery_api_v1_projects__slug__alert_deliveries__delivery_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: delivery_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Delivery Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertDeliveryDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-deliveries/{delivery_id}/retry:
    post:
      tags:
        - alerting
      summary: Retry Alert Delivery
      operationId: >-
        retry_alert_delivery_api_v1_projects__slug__alert_deliveries__delivery_id__retry_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: delivery_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Delivery Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertDeliveryDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/monitors/{rule_id}:
    get:
      tags:
        - alerting
      summary: Get Monitor
      operationId: get_monitor_api_v1_projects__slug__monitors__rule_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: rule_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Rule Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/monitors/{rule_id}/mute:
    post:
      tags:
        - alerting
      summary: Mute Monitor
      operationId: mute_monitor_api_v1_projects__slug__monitors__rule_id__mute_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: rule_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Rule Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MonitorMuteRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/monitors/{rule_id}/unmute:
    post:
      tags:
        - alerting
      summary: Unmute Monitor
      operationId: unmute_monitor_api_v1_projects__slug__monitors__rule_id__unmute_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: rule_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Rule Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-inbox:
    get:
      tags:
        - alerting
      summary: List Alert Inbox
      operationId: list_alert_inbox_api_v1_projects__slug__alert_inbox_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/AlertInboxStatus'
              - type: 'null'
            title: Status
        - name: last_fired_from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Last Fired From
        - name: last_fired_to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Last Fired To
        - name: scope_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/MetricScopeType'
              - type: 'null'
            title: Scope Type
        - name: direction
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/AnomalyDirection'
              - type: 'null'
            title: Direction
        - name: scope
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 200
              - type: 'null'
            title: Scope
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 50
            title: Limit
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 512
              - type: 'null'
            title: Cursor
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertInboxListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-inbox/bulk-actions:
    post:
      tags:
        - alerting
      summary: Apply Alert Inbox Bulk Action
      description: >-
        Apply one triage decision to a selection of incidents.


        A shortcut for N clicks on the sibling single-incident route, not a new
        kind

        of object: the decision is copied into each incident's own state. The
        service

        validates every id before mutating anything and commits once, so this
        either

        applies to the whole selection or to none of it.
      operationId: >-
        apply_alert_inbox_bulk_action_api_v1_projects__slug__alert_inbox_bulk_actions_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertInboxBulkActionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertInboxBulkActionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-inbox/{correlation_group_id}:
    get:
      tags:
        - alerting
      summary: Get Alert Inbox Group
      description: >-
        Resolve one incident by id, ignoring the list's lookback window.


        Alert messages deep-link the incident they describe, and the reader
        opens

        them late; before this route the link landed on a page of 20 unrelated

        incidents with no explanation.
      operationId: >-
        get_alert_inbox_group_api_v1_projects__slug__alert_inbox__correlation_group_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: correlation_group_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Correlation Group Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertInboxGroupResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-inbox/{correlation_group_id}/actions:
    post:
      tags:
        - alerting
      summary: Apply Alert Inbox Action
      operationId: >-
        apply_alert_inbox_action_api_v1_projects__slug__alert_inbox__correlation_group_id__actions_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: correlation_group_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Correlation Group Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AlertInboxActionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AlertInboxActionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-inbox/{correlation_group_id}/notify-owners:
    post:
      tags:
        - alerting
      summary: Notify Alert Inbox Owners
      description: >-
        Email the owners of this incident's event type / metric once, now (F07,
        #260).


        Answers with one row per owner tried; a ``skipped`` or ``failed`` owner
        is

        part of the answer, not an error. No owners is an empty list. An owner

        emailed about this incident in the last 10 minutes is ``skipped``
        ("notified

        N minutes ago"); at most 20 owners are contacted per request.
      operationId: >-
        notify_alert_inbox_owners_api_v1_projects__slug__alert_inbox__correlation_group_id__notify_owners_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: correlation_group_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Correlation Group Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotifyOwnersResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-inbox/{correlation_group_id}/summary:
    get:
      tags:
        - alerting
      summary: Get Incident Summary
      description: The cached summary and whether it is current. Never calls the LLM.
      operationId: >-
        get_incident_summary_api_v1_projects__slug__alert_inbox__correlation_group_id__summary_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: correlation_group_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Correlation Group Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IncidentSummaryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - alerting
      summary: Ensure Incident Summary
      description: >-
        The summary for the current facts: cached when unchanged, else
        generated.


        Any member may call it, but not a ``read`` API key: generating writes a
        row

        and spends the provider budget, so a read key only gets the GET.
      operationId: >-
        ensure_incident_summary_api_v1_projects__slug__alert_inbox__correlation_group_id__summary_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: correlation_group_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Correlation Group Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IncidentSummaryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/alert-inbox/{correlation_group_id}/summary/regenerate:
    post:
      tags:
        - alerting
      summary: Regenerate Incident Summary
      description: Generate the summary again, whatever the cache holds. Editors only.
      operationId: >-
        regenerate_incident_summary_api_v1_projects__slug__alert_inbox__correlation_group_id__summary_regenerate_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: correlation_group_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Correlation Group Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IncidentSummaryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/event-types:
    get:
      tags:
        - event-types
      summary: List Event Types
      operationId: list_event_types_api_v1_projects__slug__event_types_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventTypeResponse'
                title: >-
                  Response List Event Types Api V1 Projects  Slug  Event Types
                  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - event-types
      summary: Create Event Type
      operationId: create_event_type_api_v1_projects__slug__event_types_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventTypeCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventTypeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/event-types/{event_type_id}:
    get:
      tags:
        - event-types
      summary: Get Event Type
      operationId: get_event_type_api_v1_projects__slug__event_types__event_type_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventTypeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - event-types
      summary: Update Event Type
      operationId: >-
        update_event_type_api_v1_projects__slug__event_types__event_type_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventTypeUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventTypeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - event-types
      summary: Delete Event Type
      operationId: >-
        delete_event_type_api_v1_projects__slug__event_types__event_type_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/event-types/{event_type_id}/drifts:
    get:
      tags:
        - event-types
      summary: List Event Type Drifts
      operationId: >-
        list_event_type_drifts_api_v1_projects__slug__event_types__event_type_id__drifts_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaDriftListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/event-types/drifts/{drift_id}/actions:
    post:
      tags:
        - event-types
      summary: Apply Schema Drift Action
      operationId: >-
        apply_schema_drift_action_api_v1_projects__slug__event_types_drifts__drift_id__actions_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: drift_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Drift Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SchemaDriftActionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SchemaDriftResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/event-types/{event_type_id}/owners:
    get:
      tags:
        - event-type-owners
      summary: List Owners
      operationId: >-
        list_owners_api_v1_projects__slug__event_types__event_type_id__owners_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventTypeOwnerResponse'
                title: >-
                  Response List Owners Api V1 Projects  Slug  Event Types  Event
                  Type Id  Owners Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - event-type-owners
      summary: Add Owner
      operationId: add_owner_api_v1_projects__slug__event_types__event_type_id__owners_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventTypeOwnerCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventTypeOwnerResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/event-types/{event_type_id}/owners/{owner_id}:
    delete:
      tags:
        - event-type-owners
      summary: Remove Owner
      operationId: >-
        remove_owner_api_v1_projects__slug__event_types__event_type_id__owners__owner_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
        - name: owner_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Owner Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/event-type-owners:
    get:
      tags:
        - event-type-owners
      summary: List Project Owners
      description: >-
        Owners of every live event type in the project; group by
        ``event_type_id``.
      operationId: list_project_owners_api_v1_projects__slug__event_type_owners_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventTypeOwnerResponse'
                title: >-
                  Response List Project Owners Api V1 Projects  Slug  Event Type
                  Owners Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/event-types/{event_type_id}/fields:
    get:
      tags:
        - fields
      summary: List Fields
      operationId: >-
        list_fields_api_v1_projects__slug__event_types__event_type_id__fields_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FieldDefinitionResponse'
                title: >-
                  Response List Fields Api V1 Projects  Slug  Event Types  Event
                  Type Id  Fields Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - fields
      summary: Create Field
      operationId: >-
        create_field_api_v1_projects__slug__event_types__event_type_id__fields_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FieldDefinitionCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FieldDefinitionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/event-types/{event_type_id}/fields/bulk:
    post:
      tags:
        - fields
      summary: Bulk Create Fields
      operationId: >-
        bulk_create_fields_api_v1_projects__slug__event_types__event_type_id__fields_bulk_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FieldDefinitionBulkCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FieldDefinitionResponse'
                title: >-
                  Response Bulk Create Fields Api V1 Projects  Slug  Event
                  Types  Event Type Id  Fields Bulk Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/event-types/{event_type_id}/fields/reorder:
    patch:
      tags:
        - fields
      summary: Reorder Fields
      operationId: >-
        reorder_fields_api_v1_projects__slug__event_types__event_type_id__fields_reorder_patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FieldReorder'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FieldDefinitionResponse'
                title: >-
                  Response Reorder Fields Api V1 Projects  Slug  Event Types 
                  Event Type Id  Fields Reorder Patch
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/event-types/{event_type_id}/fields/{field_id}:
    patch:
      tags:
        - fields
      summary: Update Field
      operationId: >-
        update_field_api_v1_projects__slug__event_types__event_type_id__fields__field_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
        - name: field_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Field Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FieldDefinitionUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FieldDefinitionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - fields
      summary: Delete Field
      operationId: >-
        delete_field_api_v1_projects__slug__event_types__event_type_id__fields__field_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
        - name: field_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Field Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/relations:
    get:
      tags:
        - relations
      summary: List Relations
      operationId: list_relations_api_v1_projects__slug__relations_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RelationResponse'
                title: Response List Relations Api V1 Projects  Slug  Relations Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - relations
      summary: Create Relation
      operationId: create_relation_api_v1_projects__slug__relations_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RelationCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/relations/{relation_id}:
    patch:
      tags:
        - relations
      summary: Update Relation
      operationId: update_relation_api_v1_projects__slug__relations__relation_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: relation_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Relation Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RelationUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RelationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - relations
      summary: Delete Relation
      operationId: delete_relation_api_v1_projects__slug__relations__relation_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: relation_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Relation Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/meta-fields:
    get:
      tags:
        - meta-fields
      summary: List Meta Fields
      operationId: list_meta_fields_api_v1_projects__slug__meta_fields_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MetaFieldResponse'
                title: >-
                  Response List Meta Fields Api V1 Projects  Slug  Meta Fields
                  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - meta-fields
      summary: Create Meta Field
      operationId: create_meta_field_api_v1_projects__slug__meta_fields_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetaFieldCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetaFieldResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/meta-fields/{meta_field_id}/usage:
    get:
      tags:
        - meta-fields
      summary: Get Meta Field Usage
      description: Values and events a delete of this field would clear.
      operationId: >-
        get_meta_field_usage_api_v1_projects__slug__meta_fields__meta_field_id__usage_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: meta_field_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Meta Field Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetaFieldUsageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/meta-fields/{meta_field_id}:
    patch:
      tags:
        - meta-fields
      summary: Update Meta Field
      operationId: >-
        update_meta_field_api_v1_projects__slug__meta_fields__meta_field_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: meta_field_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Meta Field Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetaFieldUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetaFieldResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - meta-fields
      summary: Delete Meta Field
      operationId: >-
        delete_meta_field_api_v1_projects__slug__meta_fields__meta_field_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: meta_field_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Meta Field Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/duplicate-check:
    post:
      tags:
        - duplicates
      summary: Duplicate Check
      description: |-
        Likely duplicates and naming-convention lint for would-be events.

        Up to 500 candidates, answered in order. Changes nothing.
      operationId: duplicate_check_api_v1_projects__slug__events_duplicate_check_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DuplicateCheckRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DuplicateCheckResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events:
    get:
      tags:
        - events
      summary: List Events
      operationId: list_events_api_v1_projects__slug__events_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Event Type Id
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Search
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/EventStatus'
              - type: 'null'
            title: Status
        - name: tag
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Tag
        - name: silent_since_days
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 3650
                minimum: 0
              - type: 'null'
            title: Silent Since Days
        - name: reviewed
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Reviewed
        - name: has_open_questions
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Has Open Questions
        - name: field_value
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Field Value
        - name: meta_value
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Meta Value
        - name: property
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'Property id or name: only events whose property list carries it.'
            title: Property
          description: 'Property id or name: only events whose property list carries it.'
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 10000
            minimum: 1
            default: 200
            title: Limit
        - name: order_by
          in: query
          required: false
          schema:
            enum:
              - catalog
              - volume
              - health
            type: string
            default: catalog
            title: Order By
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - events
      summary: Create Event
      operationId: create_event_api_v1_projects__slug__events_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventMutationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/tags:
    get:
      tags:
        - events
      summary: List Tags
      operationId: list_tags_api_v1_projects__slug__events_tags_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                title: Response List Tags Api V1 Projects  Slug  Events Tags Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/by-names:
    get:
      tags:
        - events
      summary: Lookup Events By Names
      operationId: lookup_events_by_names_api_v1_projects__slug__events_by_names_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: query
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
        - name: names
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
            minItems: 1
            maxItems: 200
            title: Names
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventIdentityHoldersResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/bulk:
    post:
      tags:
        - events
      summary: Bulk Create Events
      operationId: bulk_create_events_api_v1_projects__slug__events_bulk_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/EventCreate'
              title: Data
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventResponse'
                title: >-
                  Response Bulk Create Events Api V1 Projects  Slug  Events Bulk
                  Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/bulk-delete:
    post:
      tags:
        - events
      summary: Bulk Delete Events
      operationId: bulk_delete_events_api_v1_projects__slug__events_bulk_delete_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventBulkDelete'
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/bulk-update:
    post:
      tags:
        - events
      summary: Bulk Update Events
      operationId: bulk_update_events_api_v1_projects__slug__events_bulk_update_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventBulkUpdate'
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/reorder:
    patch:
      tags:
        - events
      summary: Reorder Events
      operationId: reorder_events_api_v1_projects__slug__events_reorder_patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventReorder'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventResponse'
                title: >-
                  Response Reorder Events Api V1 Projects  Slug  Events Reorder
                  Patch
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}:
    get:
      tags:
        - events
      summary: Get Event
      operationId: get_event_api_v1_projects__slug__events__event_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - events
      summary: Update Event
      operationId: update_event_api_v1_projects__slug__events__event_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventMutationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - events
      summary: Delete Event
      operationId: delete_event_api_v1_projects__slug__events__event_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/properties:
    get:
      tags:
        - events
      summary: List Event Properties
      description: |-
        The event's property list (F23). Edit an entry through
        ``PUT /variables/{variable_id}/event-overrides/{event_id}``.
      operationId: >-
        list_event_properties_api_v1_projects__slug__events__event_id__properties_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventPropertyResponse'
                title: >-
                  Response List Event Properties Api V1 Projects  Slug  Events 
                  Event Id  Properties Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/history:
    get:
      tags:
        - events
      summary: Get Event History
      operationId: get_event_history_api_v1_projects__slug__events__event_id__history_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventChangeResponse'
                title: >-
                  Response Get Event History Api V1 Projects  Slug  Events 
                  Event Id  History Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/move:
    patch:
      tags:
        - events
      summary: Move Event
      operationId: move_event_api_v1_projects__slug__events__event_id__move_patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventMove'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/lifecycle-findings:
    get:
      tags:
        - lifecycle
      summary: List Lifecycle Findings
      description: >-
        Open findings of the daily sunset watch; ``?include_resolved=true`` adds
        the closed ones.
      operationId: list_lifecycle_findings_api_v1_projects__slug__lifecycle_findings_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: include_resolved
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Include Resolved
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LifecycleFindingListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/migration:
    get:
      tags:
        - lifecycle
      summary: Get Event Migration
      description: |-
        Successor adoption: the old and the new event's 7-day daily average.

        404 when the event names no successor.
      operationId: >-
        get_event_migration_api_v1_projects__slug__events__event_id__migration_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventMigrationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/health/events:
    get:
      tags:
        - health
      summary: List Events Health
      description: >-
        Health of up to 150 events; ids outside the scored population are
        omitted.
      operationId: list_events_health_api_v1_projects__slug__health_events_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: ids
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
              format: uuid
            minItems: 1
            maxItems: 150
            title: Ids
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventHealthListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/health/event-types:
    get:
      tags:
        - health
      summary: List Event Types Health
      description: >-
        Per event type: mean score, grade counts, component averages, worst
        events.
      operationId: list_event_types_health_api_v1_projects__slug__health_event_types_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventTypeHealthListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/health:
    get:
      tags:
        - health
      summary: Get Project Health
      description: 'Plan health: mean score, distribution, worst five and the daily trend.'
      operationId: get_project_health_api_v1_projects__slug__health_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: trend_days
          in: query
          required: false
          schema:
            type: integer
            maximum: 365
            minimum: 1
            default: 30
            title: Trend Days
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectHealthResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/health:
    get:
      tags:
        - health
      summary: Get Event Health
      description: One event's score with its component breakdown. 404 off the main plan.
      operationId: get_event_health_api_v1_projects__slug__events__event_id__health_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventHealth'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/photos:
    get:
      tags:
        - event-photos
      summary: List Event Photos
      operationId: list_event_photos_api_v1_projects__slug__events__event_id__photos_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventPhotoResponse'
                title: >-
                  Response List Event Photos Api V1 Projects  Slug  Events 
                  Event Id  Photos Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - event-photos
      summary: Upload Event Photo
      operationId: upload_event_photo_api_v1_projects__slug__events__event_id__photos_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_upload_event_photo_api_v1_projects__slug__events__event_id__photos_post
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventPhotoResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/photos/reorder:
    patch:
      tags:
        - event-photos
      summary: Reorder Event Photos
      operationId: >-
        reorder_event_photos_api_v1_projects__slug__events__event_id__photos_reorder_patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventPhotoReorder'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventPhotoResponse'
                title: >-
                  Response Reorder Event Photos Api V1 Projects  Slug  Events 
                  Event Id  Photos Reorder Patch
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/photos/{photo_id}:
    delete:
      tags:
        - event-photos
      summary: Delete Event Photo
      operationId: >-
        delete_event_photo_api_v1_projects__slug__events__event_id__photos__photo_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: photo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Photo Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/photos/{photo_id}/file:
    get:
      tags:
        - event-photos
      summary: Download Event Photo
      description: >-
        Stream the photo bytes through the API.


        The serving path for every photo on the local backend, the default,
        whose

        files are not reachable from the browser. On GCS a photo's `url` field
        is

        a signed or public URL the browser fetches directly; when that URL
        cannot

        be made, for instance with credentials that cannot sign, the `url` field

        points here instead.
      operationId: >-
        download_event_photo_api_v1_projects__slug__events__event_id__photos__photo_id__file_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: photo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Photo Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/photos/figma:
    post:
      tags:
        - event-photos
      summary: Attach Figma Spec
      operationId: >-
        attach_figma_spec_api_v1_projects__slug__events__event_id__photos_figma_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventPhotoFigmaCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventPhotoResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/photos/{photo_id}/comments:
    get:
      tags:
        - event-photos
      summary: List Photo Comments
      operationId: >-
        list_photo_comments_api_v1_projects__slug__events__event_id__photos__photo_id__comments_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: photo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Photo Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventPhotoCommentResponse'
                title: >-
                  Response List Photo Comments Api V1 Projects  Slug  Events 
                  Event Id  Photos  Photo Id  Comments Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - event-photos
      summary: Create Photo Comment
      operationId: >-
        create_photo_comment_api_v1_projects__slug__events__event_id__photos__photo_id__comments_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: photo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Photo Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventPhotoCommentCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventPhotoCommentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/photos/{photo_id}/comments/{comment_id}:
    delete:
      tags:
        - event-photos
      summary: Delete Photo Comment
      operationId: >-
        delete_photo_comment_api_v1_projects__slug__events__event_id__photos__photo_id__comments__comment_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: photo_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Photo Id
        - name: comment_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Comment Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/comments:
    get:
      tags:
        - event-comments
      summary: List Event Comments
      operationId: >-
        list_event_comments_api_v1_projects__slug__events__event_id__comments_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventPhotoCommentResponse'
                title: >-
                  Response List Event Comments Api V1 Projects  Slug  Events 
                  Event Id  Comments Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - event-comments
      summary: Create Event Comment
      operationId: >-
        create_event_comment_api_v1_projects__slug__events__event_id__comments_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventPhotoCommentCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventPhotoCommentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/comments/{comment_id}/actions:
    post:
      tags:
        - event-comments
      summary: Apply Event Comment Action
      description: >-
        Resolve, snooze or reopen one thread.


        An ``/actions`` sub-resource, not a PATCH on the comment: the body names
        an

        intent and the service decides which of the five resolution columns move
        —

        the shape every other resolvable thing here already uses.
      operationId: >-
        apply_event_comment_action_api_v1_projects__slug__events__event_id__comments__comment_id__actions_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: comment_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Comment Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventCommentActionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventPhotoCommentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/comments/{comment_id}:
    delete:
      tags:
        - event-comments
      summary: Delete Event Comment
      operationId: >-
        delete_event_comment_api_v1_projects__slug__events__event_id__comments__comment_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: comment_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Comment Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties/bulk-update:
    post:
      tags:
        - properties
      summary: Bulk Update Variables  Properties
      operationId: >-
        bulk_update_variables__properties_api_v1_projects__slug__properties_bulk_update_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableBulkUpdate'
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties/bulk-delete:
    post:
      tags:
        - properties
      summary: Bulk Delete Variables  Properties
      operationId: >-
        bulk_delete_variables__properties_api_v1_projects__slug__properties_bulk_delete_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableBulkDelete'
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties/property-drifts:
    get:
      tags:
        - properties
      summary: List Property Drifts  Properties
      description: New, missing-required and type-changed properties a scan saw (F23).
      operationId: >-
        list_property_drifts__properties_api_v1_projects__slug__properties_property_drifts_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Variable Id
        - name: event_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Event Id
        - name: kind
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/PropertyDriftKind'
              - type: 'null'
            title: Kind
        - name: active_only
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Active Only
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PropertyDriftListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties/property-drifts/{drift_id}/action:
    post:
      tags:
        - properties
      summary: Apply Property Drift Action  Properties
      operationId: >-
        apply_property_drift_action__properties_api_v1_projects__slug__properties_property_drifts__drift_id__action_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: drift_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Drift Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PropertyDriftActionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PropertyDriftResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties/drifts:
    get:
      tags:
        - properties
      summary: List Value Drifts  Properties
      operationId: >-
        list_value_drifts__properties_api_v1_projects__slug__properties_drifts_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Variable Id
        - name: event_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Event Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableValueDriftListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties/drifts/{drift_id}/action:
    post:
      tags:
        - properties
      summary: Apply Value Drift Action  Properties
      operationId: >-
        apply_value_drift_action__properties_api_v1_projects__slug__properties_drifts__drift_id__action_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: drift_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Drift Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableValueDriftActionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableValueDriftResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties:
    get:
      tags:
        - properties
      summary: List Variables  Properties
      operationId: list_variables__properties_api_v1_projects__slug__properties_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 5000
            minimum: 1
            default: 200
            title: Limit
        - name: usage
          in: query
          required: false
          schema:
            enum:
              - all
              - used
              - unused
            type: string
            description: >-
              Narrow to the variables nothing refers to ('unused' — exactly the
              set the retirement sweep would take) or to their complement
              ('used'). Declared as an enum rather than a free string so an
              unknown value is a 422 and not a 500.
            default: all
            title: Usage
          description: >-
            Narrow to the variables nothing refers to ('unused' — exactly the
            set the retirement sweep would take) or to their complement
            ('used'). Declared as an enum rather than a free string so an
            unknown value is a 422 and not a 500.
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - properties
      summary: Create Variable  Properties
      operationId: create_variable__properties_api_v1_projects__slug__properties_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties/{variable_id}/values:
    get:
      tags:
        - properties
      summary: List Variable Values  Properties
      operationId: >-
        list_variable_values__properties_api_v1_projects__slug__properties__variable_id__values_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VariableValueContextResponse'
                title: >-
                  Response List Variable Values  Properties Api V1 Projects 
                  Slug  Properties  Variable Id  Values Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - properties
      summary: Clear Variable Values  Properties
      description: >-
        Drop the variable's observed contexts and keep the variable.


        Deleting the variable was the only reset available and it takes the

        description, documented values, bindings, overrides and drift triage
        with

        it — none of which a scan rebuilds.
      operationId: >-
        clear_variable_values__properties_api_v1_projects__slug__properties__variable_id__values_delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: context_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: >-
              Clear one context row instead of all of them. The id is the `id`
              on VariableValueContextResponse — the same value /values already
              returns, so a client can scope the clear to a single (event,
              field).
            title: Context Id
          description: >-
            Clear one context row instead of all of them. The id is the `id` on
            VariableValueContextResponse — the same value /values already
            returns, so a client can scope the clear to a single (event, field).
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties/{variable_id}/event-overrides:
    get:
      tags:
        - properties
      summary: List Event Overrides  Properties
      operationId: >-
        list_event_overrides__properties_api_v1_projects__slug__properties__variable_id__event_overrides_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VariableEventOverrideResponse'
                title: >-
                  Response List Event Overrides  Properties Api V1 Projects 
                  Slug  Properties  Variable Id  Event Overrides Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties/{variable_id}/events:
    get:
      tags:
        - properties
      summary: List Property Events  Properties
      description: |-
        The events whose property list carries this property, with each entry's
        required flag, override and last measured presence (F23.8).
      operationId: >-
        list_property_events__properties_api_v1_projects__slug__properties__variable_id__events_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PropertyEventResponse'
                title: >-
                  Response List Property Events  Properties Api V1 Projects 
                  Slug  Properties  Variable Id  Events Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties/{variable_id}/event-overrides/bulk:
    post:
      tags:
        - properties
      summary: Bulk Upsert Event Overrides  Properties
      description: >-
        Add the property to many events' lists, or apply one patch to each
        entry:

        the single PUT's semantics, all or nothing (F23.8).
      operationId: >-
        bulk_upsert_event_overrides__properties_api_v1_projects__slug__properties__variable_id__event_overrides_bulk_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PropertyEventsBulkUpsert'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PropertyEventsBulkResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties/{variable_id}/event-overrides/bulk-delete:
    post:
      tags:
        - properties
      summary: Bulk Delete Event Overrides  Properties
      description: |-
        Take the property off many events' lists (F23.8). Events that do not
        carry it are skipped, and the audit row names only the entries removed.
      operationId: >-
        bulk_delete_event_overrides__properties_api_v1_projects__slug__properties__variable_id__event_overrides_bulk_delete_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PropertyEventsBulkDelete'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PropertyEventsBulkResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties/{variable_id}/event-overrides/{event_id}:
    put:
      tags:
        - properties
      summary: Upsert Event Override  Properties
      operationId: >-
        upsert_event_override__properties_api_v1_projects__slug__properties__variable_id__event_overrides__event_id__put
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableEventOverrideUpsert'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableEventOverrideResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - properties
      summary: Delete Event Override  Properties
      operationId: >-
        delete_event_override__properties_api_v1_projects__slug__properties__variable_id__event_overrides__event_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/properties/{variable_id}:
    patch:
      tags:
        - properties
      summary: Update Variable  Properties
      operationId: >-
        update_variable__properties_api_v1_projects__slug__properties__variable_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - properties
      summary: Delete Variable  Properties
      operationId: >-
        delete_variable__properties_api_v1_projects__slug__properties__variable_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables/bulk-update:
    post:
      tags:
        - variables
      summary: Bulk Update Variables
      operationId: bulk_update_variables_api_v1_projects__slug__variables_bulk_update_post
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableBulkUpdate'
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables/bulk-delete:
    post:
      tags:
        - variables
      summary: Bulk Delete Variables
      operationId: bulk_delete_variables_api_v1_projects__slug__variables_bulk_delete_post
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableBulkDelete'
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables/property-drifts:
    get:
      tags:
        - variables
      summary: List Property Drifts
      description: New, missing-required and type-changed properties a scan saw (F23).
      operationId: >-
        list_property_drifts_api_v1_projects__slug__variables_property_drifts_get
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Variable Id
        - name: event_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Event Id
        - name: kind
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/PropertyDriftKind'
              - type: 'null'
            title: Kind
        - name: active_only
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Active Only
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PropertyDriftListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables/property-drifts/{drift_id}/action:
    post:
      tags:
        - variables
      summary: Apply Property Drift Action
      operationId: >-
        apply_property_drift_action_api_v1_projects__slug__variables_property_drifts__drift_id__action_post
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: drift_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Drift Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PropertyDriftActionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PropertyDriftResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables/drifts:
    get:
      tags:
        - variables
      summary: List Value Drifts
      operationId: list_value_drifts_api_v1_projects__slug__variables_drifts_get
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Variable Id
        - name: event_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Event Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableValueDriftListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables/drifts/{drift_id}/action:
    post:
      tags:
        - variables
      summary: Apply Value Drift Action
      operationId: >-
        apply_value_drift_action_api_v1_projects__slug__variables_drifts__drift_id__action_post
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: drift_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Drift Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableValueDriftActionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableValueDriftResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables:
    get:
      tags:
        - variables
      summary: List Variables
      operationId: list_variables_api_v1_projects__slug__variables_get
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 5000
            minimum: 1
            default: 200
            title: Limit
        - name: usage
          in: query
          required: false
          schema:
            enum:
              - all
              - used
              - unused
            type: string
            description: >-
              Narrow to the variables nothing refers to ('unused' — exactly the
              set the retirement sweep would take) or to their complement
              ('used'). Declared as an enum rather than a free string so an
              unknown value is a 422 and not a 500.
            default: all
            title: Usage
          description: >-
            Narrow to the variables nothing refers to ('unused' — exactly the
            set the retirement sweep would take) or to their complement
            ('used'). Declared as an enum rather than a free string so an
            unknown value is a 422 and not a 500.
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - variables
      summary: Create Variable
      operationId: create_variable_api_v1_projects__slug__variables_post
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables/{variable_id}/values:
    get:
      tags:
        - variables
      summary: List Variable Values
      operationId: >-
        list_variable_values_api_v1_projects__slug__variables__variable_id__values_get
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VariableValueContextResponse'
                title: >-
                  Response List Variable Values Api V1 Projects  Slug 
                  Variables  Variable Id  Values Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - variables
      summary: Clear Variable Values
      description: >-
        Drop the variable's observed contexts and keep the variable.


        Deleting the variable was the only reset available and it takes the

        description, documented values, bindings, overrides and drift triage
        with

        it — none of which a scan rebuilds.
      operationId: >-
        clear_variable_values_api_v1_projects__slug__variables__variable_id__values_delete
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: context_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: >-
              Clear one context row instead of all of them. The id is the `id`
              on VariableValueContextResponse — the same value /values already
              returns, so a client can scope the clear to a single (event,
              field).
            title: Context Id
          description: >-
            Clear one context row instead of all of them. The id is the `id` on
            VariableValueContextResponse — the same value /values already
            returns, so a client can scope the clear to a single (event, field).
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables/{variable_id}/event-overrides:
    get:
      tags:
        - variables
      summary: List Event Overrides
      operationId: >-
        list_event_overrides_api_v1_projects__slug__variables__variable_id__event_overrides_get
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VariableEventOverrideResponse'
                title: >-
                  Response List Event Overrides Api V1 Projects  Slug 
                  Variables  Variable Id  Event Overrides Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables/{variable_id}/events:
    get:
      tags:
        - variables
      summary: List Property Events
      description: |-
        The events whose property list carries this property, with each entry's
        required flag, override and last measured presence (F23.8).
      operationId: >-
        list_property_events_api_v1_projects__slug__variables__variable_id__events_get
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PropertyEventResponse'
                title: >-
                  Response List Property Events Api V1 Projects  Slug 
                  Variables  Variable Id  Events Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables/{variable_id}/event-overrides/bulk:
    post:
      tags:
        - variables
      summary: Bulk Upsert Event Overrides
      description: >-
        Add the property to many events' lists, or apply one patch to each
        entry:

        the single PUT's semantics, all or nothing (F23.8).
      operationId: >-
        bulk_upsert_event_overrides_api_v1_projects__slug__variables__variable_id__event_overrides_bulk_post
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PropertyEventsBulkUpsert'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PropertyEventsBulkResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables/{variable_id}/event-overrides/bulk-delete:
    post:
      tags:
        - variables
      summary: Bulk Delete Event Overrides
      description: |-
        Take the property off many events' lists (F23.8). Events that do not
        carry it are skipped, and the audit row names only the entries removed.
      operationId: >-
        bulk_delete_event_overrides_api_v1_projects__slug__variables__variable_id__event_overrides_bulk_delete_post
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PropertyEventsBulkDelete'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PropertyEventsBulkResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables/{variable_id}/event-overrides/{event_id}:
    put:
      tags:
        - variables
      summary: Upsert Event Override
      operationId: >-
        upsert_event_override_api_v1_projects__slug__variables__variable_id__event_overrides__event_id__put
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableEventOverrideUpsert'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableEventOverrideResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - variables
      summary: Delete Event Override
      operationId: >-
        delete_event_override_api_v1_projects__slug__variables__variable_id__event_overrides__event_id__delete
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/variables/{variable_id}:
    patch:
      tags:
        - variables
      summary: Update Variable
      operationId: update_variable_api_v1_projects__slug__variables__variable_id__patch
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VariableUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VariableResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - variables
      summary: Delete Variable
      operationId: delete_variable_api_v1_projects__slug__variables__variable_id__delete
      deprecated: true
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: variable_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Variable Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/data-sources:
    get:
      tags:
        - data-sources
      summary: List Data Sources
      operationId: list_data_sources_api_v1_data_sources_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/DataSourceResponse'
                type: array
                title: Response List Data Sources Api V1 Data Sources Get
    post:
      tags:
        - data-sources
      summary: Create Data Source
      operationId: create_data_source_api_v1_data_sources_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataSourceCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/data-sources/test:
    post:
      tags:
        - data-sources
      summary: Test Unsaved Data Source Connection
      description: >-
        Test a connection before it is saved.


        The create gate (org owner/admin, browser session) and the create body's
        validation,

        host format included; nothing is stored and no stored secret is read.
        Always

        200: a refused connection is the answer the caller asked for.
      operationId: test_unsaved_data_source_connection_api_v1_data_sources_test_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataSourceConnectionTest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceConnectionTestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/data-sources/{ds_id}:
    get:
      tags:
        - data-sources
      summary: Get Data Source
      operationId: get_data_source_api_v1_data_sources__ds_id__get
      parameters:
        - name: ds_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Ds Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - data-sources
      summary: Update Data Source
      operationId: update_data_source_api_v1_data_sources__ds_id__patch
      parameters:
        - name: ds_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Ds Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataSourceUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - data-sources
      summary: Delete Data Source
      operationId: delete_data_source_api_v1_data_sources__ds_id__delete
      parameters:
        - name: ds_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Ds Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/data-sources/{ds_id}/stats:
    get:
      tags:
        - data-sources
      summary: Get Data Source Stats
      operationId: get_data_source_stats_api_v1_data_sources__ds_id__stats_get
      parameters:
        - name: ds_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Ds Id
        - name: window_hours
          in: query
          required: false
          schema:
            type: integer
            maximum: 720
            minimum: 1
            default: 48
            title: Window Hours
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceStatsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/data-sources/{ds_id}/schema:
    get:
      tags:
        - data-sources
      summary: Get Data Source Schema
      operationId: get_data_source_schema_api_v1_data_sources__ds_id__schema_get
      parameters:
        - name: ds_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Ds Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceSchemaResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/data-sources/{ds_id}/test:
    post:
      tags:
        - data-sources
      summary: Test Data Source Connection
      operationId: test_data_source_connection_api_v1_data_sources__ds_id__test_post
      parameters:
        - name: ds_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Ds Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataSourceTestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans:
    get:
      tags:
        - scans
      summary: List Scan Configs
      operationId: list_scan_configs_api_v1_projects__slug__scans_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ScanConfigResponse'
                title: Response List Scan Configs Api V1 Projects  Slug  Scans Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - scans
      summary: Create Scan Config
      operationId: create_scan_config_api_v1_projects__slug__scans_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanConfigCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanConfigResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/activity:
    get:
      tags:
        - scans
      summary: Get Scan Activity
      description: >-
        Each scan's latest job, failing streak and rows read in the last 24
        hours.


        One request for the whole Scans list, aggregated in SQL, so the streak
        and

        the 24h total are exact rather than floors over a capped page of jobs.
      operationId: get_scan_activity_api_v1_projects__slug__scans_activity_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanActivityResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/preview:
    post:
      tags:
        - scans
      summary: Preview Scan Config
      description: Enqueue a preview job; poll GET /preview-jobs/{job_id} for the result.
      operationId: preview_scan_config_api_v1_projects__slug__scans_preview_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanConfigPreviewRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanPreviewJobResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/preview-jobs/{job_id}:
    get:
      tags:
        - scans
      summary: Get Scan Preview Job
      operationId: >-
        get_scan_preview_job_api_v1_projects__slug__scans_preview_jobs__job_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Job Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanPreviewJobResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/dry-run:
    post:
      tags:
        - scans
      summary: Dry Run Scan Config
      description: |-
        Enqueue a dry-run; poll GET /dry-run-jobs/{job_id} for the result.

        Owner-only for the same reason preview is: the SQL is free text from a
        draft, executed verbatim against a stored warehouse credential.
      operationId: dry_run_scan_config_api_v1_projects__slug__scans_dry_run_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanDryRunRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanDryRunJobResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/dry-run-jobs/{job_id}:
    get:
      tags:
        - scans
      summary: Get Scan Dry Run Job
      operationId: >-
        get_scan_dry_run_job_api_v1_projects__slug__scans_dry_run_jobs__job_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Job Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanDryRunJobResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_id}:
    get:
      tags:
        - scans
      summary: Get Scan Config
      operationId: get_scan_config_api_v1_projects__slug__scans__scan_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanConfigDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - scans
      summary: Update Scan Config
      operationId: update_scan_config_api_v1_projects__slug__scans__scan_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanConfigUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanConfigResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - scans
      summary: Delete Scan Config
      operationId: delete_scan_config_api_v1_projects__slug__scans__scan_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_id}/platform-presence:
    get:
      tags:
        - scans
      summary: Get Platform Presence
      description: >-
        Per-event platform presence matrix for the scan's platform_column.


        Empty when the scan has no platform_column set (the platform dimension
        is

        inert), so callers can render the panel unconditionally.
      operationId: >-
        get_platform_presence_api_v1_projects__slug__scans__scan_id__platform_presence_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformPresenceResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_id}/run:
    post:
      tags:
        - scans
      summary: Run Scan
      operationId: run_scan_api_v1_projects__slug__scans__scan_id__run_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Id
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanJobResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_id}/event-groups/apply:
    post:
      tags:
        - scans
      summary: Apply Scan Event Groups
      operationId: >-
        apply_scan_event_groups_api_v1_projects__slug__scans__scan_id__event_groups_apply_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Id
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanJobResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_id}/metrics/replay:
    post:
      tags:
        - scans
      summary: Replay Scan Metrics
      operationId: >-
        replay_scan_metrics_api_v1_projects__slug__scans__scan_id__metrics_replay_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanMetricsReplayRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanJobResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_id}/jobs:
    get:
      tags:
        - scans
      summary: List Scan Jobs
      description: >-
        Newest jobs first, capped.


        This was uncapped, and the Scans tab fans it out over every scan config
        on a

        10-second poll: production configs hold 1,366-1,551 jobs each, so an
        open tab

        pulled roughly 4,400 rows every 10 seconds and rendered them
        unvirtualized.
      operationId: list_scan_jobs_api_v1_projects__slug__scans__scan_id__jobs_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 50
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ScanJobResponse'
                title: >-
                  Response List Scan Jobs Api V1 Projects  Slug  Scans  Scan Id 
                  Jobs Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_id}/jobs/{job_id}:
    get:
      tags:
        - scans
      summary: Get Scan Job
      operationId: get_scan_job_api_v1_projects__slug__scans__scan_id__jobs__job_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Id
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Job Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanJobResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_id}/jobs/{job_id}/cancel:
    post:
      tags:
        - scans
      summary: Cancel Scan Job
      operationId: >-
        cancel_scan_job_api_v1_projects__slug__scans__scan_id__jobs__job_id__cancel_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Id
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Job Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanJobResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/source-freshness:
    get:
      tags:
        - scans
      summary: List Source Freshness
      description: >-
        Each scan config's freshness: fresh, late, overdue or unknown.


        Computed on read from what the latest collection recorded, so a scan
        whose

        worker has stopped turns ``overdue`` without any job having to say so.
      operationId: list_source_freshness_api_v1_projects__slug__source_freshness_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SourceFreshnessItem'
                title: >-
                  Response List Source Freshness Api V1 Projects  Slug  Source
                  Freshness Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/search:
    get:
      tags:
        - search
      summary: Search Project
      operationId: search_project_api_v1_projects__slug__search_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: q
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 500
            title: Q
        - name: types
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  enum:
                    - event
                    - event_type
                    - field
                    - meta_field
                    - variable
                    - relation
                    - tag
                    - metric
                    - fact_table
                    - scan_config
                    - alert_rule
                    - doc
                  type: string
              - type: 'null'
            title: Types
        - name: include_archived
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Include Archived
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
            title: Limit
        - name: semantic
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Run the embedding leg as well as the lexical one. Pass false for a
              keyword-only answer that skips the provider round trip;
              ``semantic_used`` in the response is then always false.
            default: true
            title: Semantic
          description: >-
            Run the embedding leg as well as the lexical one. Pass false for a
            keyword-only answer that skips the provider round trip;
            ``semantic_used`` in the response is then always false.
        - name: group_variants
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Fold events of one event type whose names differ only in one
              naming-rule placeholder into their best-ranked member, which then
              carries ``variant_group``. ``limit`` and ``total`` count the
              folded rows.
            default: false
            title: Group Variants
          description: >-
            Fold events of one event type whose names differ only in one
            naming-rule placeholder into their best-ranked member, which then
            carries ``variant_group``. ``limit`` and ``total`` count the folded
            rows.
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/search/reindex:
    post:
      tags:
        - search
      summary: Reindex Project Search
      operationId: reindex_project_search_api_v1_projects__slug__search_reindex_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchReindexResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events-metrics:
    get:
      tags:
        - metrics
      summary: Get Events Metrics
      operationId: get_events_metrics_api_v1_projects__slug__events_metrics_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Event Type Id
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Search
        - name: tag
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Tag
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/EventStatus'
              - type: 'null'
            title: Status
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventMetricsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/window-metrics:
    post:
      tags:
        - metrics
      summary: Get Events Window Metrics
      operationId: >-
        get_events_window_metrics_api_v1_projects__slug__events_window_metrics_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventWindowMetricsRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EventWindowMetricsResponse'
                title: >-
                  Response Get Events Window Metrics Api V1 Projects  Slug 
                  Events Window Metrics Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/overview/kpi-series:
    get:
      tags:
        - metrics
      summary: Get Overview Kpi Series
      operationId: get_overview_kpi_series_api_v1_projects__slug__overview_kpi_series_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: days
          in: query
          required: false
          schema:
            type: integer
            maximum: 365
            minimum: 1
            default: 14
            title: Days
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OverviewKpiSeriesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/overview/top-events:
    get:
      tags:
        - metrics
      summary: Get Overview Top Events
      operationId: get_overview_top_events_api_v1_projects__slug__overview_top_events_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: window_hours
          in: query
          required: false
          schema:
            type: integer
            maximum: 720
            minimum: 1
            default: 48
            title: Window Hours
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 6
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TopEventResponse'
                title: >-
                  Response Get Overview Top Events Api V1 Projects  Slug 
                  Overview Top Events Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics/total:
    get:
      tags:
        - metrics
      summary: Get Project Total Metrics
      operationId: get_project_total_metrics_api_v1_projects__slug__metrics_total_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_config_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Scan Config Id
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventMetricsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/metrics:
    get:
      tags:
        - metrics
      summary: Get Event Metrics
      operationId: get_event_metrics_api_v1_projects__slug__events__event_id__metrics_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventMetricsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/metrics/breakdowns:
    get:
      tags:
        - metrics
      summary: Get Event Metric Breakdowns
      operationId: >-
        get_event_metric_breakdowns_api_v1_projects__slug__events__event_id__metrics_breakdowns_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: column
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Column
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventMetricBreakdownsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/event-types/{event_type_id}/metrics:
    get:
      tags:
        - metrics
      summary: Get Event Type Metrics
      operationId: >-
        get_event_type_metrics_api_v1_projects__slug__event_types__event_type_id__metrics_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_type_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Type Id
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventMetricsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/anomalies/signals:
    get:
      tags:
        - metrics
      summary: Get Active Signals
      description: >-
        Cacheable no-args variant. For filtering by a large event-id list

        (>>a few), prefer ``POST /anomalies/signals/query`` — GET's query-string

        overflow is real once you cross ~50 ids (proxy/browser limits).


        ``expanded=true`` (the AnomaliesPage view) also surfaces per-event
        scopes

        and keeps each incident's child rows, tagged ``incident_child`` rather
        than

        collapsed into the parent project_total signal.


        ``needs_verdict=true`` keeps only signals with no verdict that nothing

        hides — the Anomalies page's default filter (F01, #254).
      operationId: get_active_signals_api_v1_projects__slug__anomalies_signals_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
                  format: uuid
              - type: 'null'
            title: Event Id
        - name: expanded
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Expanded
        - name: needs_verdict
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Needs Verdict
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MetricSignalResponse'
                title: >-
                  Response Get Active Signals Api V1 Projects  Slug  Anomalies
                  Signals Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/anomalies/signals/query:
    post:
      tags:
        - metrics
      summary: Query Active Signals
      operationId: query_active_signals_api_v1_projects__slug__anomalies_signals_query_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActiveSignalsQuery'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MetricSignalResponse'
                title: >-
                  Response Query Active Signals Api V1 Projects  Slug  Anomalies
                  Signals Query Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/anomalies/{anomaly_id}/attribution:
    get:
      tags:
        - metrics
      summary: Get Anomaly Attribution
      description: >-
        Why did it change, for one anomaly (F02, #255): the contribution

        breakdown and release context stored when it was detected, for lazy
        loading

        (a chart marker other than the latest signal). 404 when the anomaly is
        not

        this project's.
      operationId: >-
        get_anomaly_attribution_api_v1_projects__slug__anomalies__anomaly_id__attribution_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: anomaly_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Anomaly Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnomalyAttributionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/anomalies/signals/series:
    post:
      tags:
        - metrics
      summary: Query Signal Series
      description: >-
        Row sparklines for many open signals in one request. POST for

        the same reason as ``/signals/query``: the batch outgrows a query
        string.
      operationId: query_signal_series_api_v1_projects__slug__anomalies_signals_series_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignalSeriesQuery'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SignalSeriesResponse'
                title: >-
                  Response Query Signal Series Api V1 Projects  Slug  Anomalies
                  Signals Series Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/anomalies/signals/acknowledge:
    post:
      tags:
        - metrics
      summary: Acknowledge Signal
      operationId: >-
        acknowledge_signal_api_v1_projects__slug__anomalies_signals_acknowledge_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignalTriageScope'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignalTriageState'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - metrics
      summary: Unacknowledge Signal
      operationId: >-
        unacknowledge_signal_api_v1_projects__slug__anomalies_signals_acknowledge_delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope_type
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/MetricScopeType'
        - name: scope_ref
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 64
            title: Scope Ref
        - name: bucket
          in: query
          required: true
          schema:
            type: string
            format: date-time
            title: Bucket
        - name: scan_config_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Scan Config Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/anomalies/signals/mute:
    post:
      tags:
        - metrics
      summary: Mute Signal Scope
      description: Hide every signal on the scope for 24 h, 7 d or until unmuted.
      operationId: mute_signal_scope_api_v1_projects__slug__anomalies_signals_mute_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignalMuteRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignalTriageState'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - metrics
      summary: Unmute Signal Scope
      operationId: unmute_signal_scope_api_v1_projects__slug__anomalies_signals_mute_delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope_type
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/MetricScopeType'
        - name: scope_ref
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 64
            title: Scope Ref
        - name: scan_config_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Scan Config Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/anomalies/signals/expected:
    post:
      tags:
        - metrics
      summary: Mark Signal Expected
      description: 'Record a known cause: annotate the signal''s bucket and hide the signal.'
      operationId: >-
        mark_signal_expected_api_v1_projects__slug__anomalies_signals_expected_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignalExpectedRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignalTriageState'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - metrics
      summary: Unmark Signal Expected
      operationId: >-
        unmark_signal_expected_api_v1_projects__slug__anomalies_signals_expected_delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope_type
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/MetricScopeType'
        - name: scope_ref
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 64
            title: Scope Ref
        - name: bucket
          in: query
          required: true
          schema:
            type: string
            format: date-time
            title: Bucket
        - name: scan_config_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Scan Config Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/signals/notify-owners:
    post:
      tags:
        - metrics
      summary: Notify Signal Owners
      description: >-
        Email the owners of a signal's event type / metric once, now (F07,
        #260).


        The "Notify owners" action for a signal no rule routed to an incident.
        One

        row per owner tried; no owners is an empty list; an unknown signal is
        404.

        An owner emailed about this signal in the last 10 minutes is ``skipped``

        ("notified N minutes ago"); at most 20 owners are contacted per request.
      operationId: notify_signal_owners_api_v1_projects__slug__signals_notify_owners_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignalTriageScope'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotifyOwnersResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/signals/verdict:
    post:
      tags:
        - metrics
      summary: Set Signal Verdict
      operationId: set_signal_verdict_api_v1_projects__slug__signals_verdict_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignalVerdictRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignalVerdictResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - metrics
      summary: Clear Signal Verdict
      operationId: clear_signal_verdict_api_v1_projects__slug__signals_verdict_delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope_type
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/MetricScopeType'
        - name: scope_ref
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 64
            title: Scope Ref
        - name: bucket
          in: query
          required: true
          schema:
            type: string
            format: date-time
            title: Bucket
        - name: scan_config_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Scan Config Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/signals/verdict-counts:
    get:
      tags:
        - metrics
      summary: Get Signal Verdict Counts
      description: Verdict tallies over the open signals (for the project health score).
      operationId: >-
        get_signal_verdict_counts_api_v1_projects__slug__signals_verdict_counts_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignalVerdictCountsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_config_id}/top-movers:
    get:
      tags:
        - metrics
      summary: Get Top Movers
      description: Top-N breakdown rows that "moved" a given anomaly bucket, |z| desc.
      operationId: >-
        get_top_movers_api_v1_projects__slug__scans__scan_config_id__top_movers_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_config_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Config Id
        - name: scope_type
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/MetricScopeType'
        - name: scope_ref
          in: query
          required: true
          schema:
            type: string
            title: Scope Ref
        - name: bucket
          in: query
          required: true
          schema:
            type: string
            format: date-time
            title: Bucket
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 10
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TopMoverItem'
                title: >-
                  Response Get Top Movers Api V1 Projects  Slug  Scans  Scan
                  Config Id  Top Movers Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_config_id}/seasonality:
    get:
      tags:
        - metrics
      summary: Get Seasonality Heatmap
      description: 7×24 hour-of-day × weekday heatmap of volume and anomaly density.
      operationId: >-
        get_seasonality_heatmap_api_v1_projects__slug__scans__scan_config_id__seasonality_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_config_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Config Id
        - name: scope_type
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/MetricScopeType'
        - name: scope_ref
          in: query
          required: true
          schema:
            type: string
            title: Scope Ref
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeasonalityHeatmapResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_config_id}/breakdown-timeline:
    get:
      tags:
        - metrics
      summary: Get Breakdown Timeline
      description: Per-bucket count timeline for one breakdown_value (drill-down).
      operationId: >-
        get_breakdown_timeline_api_v1_projects__slug__scans__scan_config_id__breakdown_timeline_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_config_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Config Id
        - name: scope_type
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/MetricScopeType'
        - name: scope_ref
          in: query
          required: true
          schema:
            type: string
            title: Scope Ref
        - name: breakdown_column
          in: query
          required: true
          schema:
            type: string
            title: Breakdown Column
        - name: breakdown_value
          in: query
          required: true
          schema:
            type: string
            title: Breakdown Value
        - name: is_other
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Is Other
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BreakdownTimelineResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_config_id}/app-versions:
    get:
      tags:
        - metrics
      summary: Get App Version Series
      operationId: >-
        get_app_version_series_api_v1_projects__slug__scans__scan_config_id__app_versions_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_config_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Config Id
        - name: scope_type
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/MetricScopeType'
            default: project_total
        - name: scope_ref
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Scope Ref
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppVersionSeriesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_config_id}/version-adoption:
    get:
      tags:
        - metrics
      summary: Get App Version Adoption
      operationId: >-
        get_app_version_adoption_api_v1_projects__slug__scans__scan_config_id__version_adoption_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_config_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Config Id
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppVersionAdoptionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/scans/{scan_config_id}/release-regressions:
    get:
      tags:
        - metrics
      summary: Get Release Regressions
      operationId: >-
        get_release_regressions_api_v1_projects__slug__scans__scan_config_id__release_regressions_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scan_config_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Scan Config Id
        - name: scope_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/MetricScopeType'
              - type: 'null'
            title: Scope Type
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReleaseRegressionsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/distribution-drifts:
    get:
      tags:
        - metrics
      summary: Get Distribution Drifts
      operationId: get_distribution_drifts_api_v1_projects__slug__distribution_drifts_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope_type
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/MetricScopeType'
        - name: scope_ref
          in: query
          required: true
          schema:
            type: string
            title: Scope Ref
        - name: scan_config_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Scan Config Id
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DistributionDriftsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics:
    get:
      tags:
        - metrics-catalog
      summary: List Metric Definitions
      operationId: list_metric_definitions_api_v1_projects__slug__metrics_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  $ref: '#/components/schemas/MetricStatus'
              - type: 'null'
            title: Status
        - name: kind
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/MetricKind'
              - type: 'null'
            title: Kind
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Search
        - name: reviewed
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Reviewed
        - name: owner_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Owner Id
        - name: fact_table_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Fact Table Id
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 200
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricDefinitionListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - metrics-catalog
      summary: Create Metric Definition
      operationId: create_metric_definition_api_v1_projects__slug__metrics_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/FactMetricCreate'
                - $ref: '#/components/schemas/SqlMetricCreate'
                - $ref: '#/components/schemas/EventCompositionMetricCreate'
              discriminator:
                propertyName: kind
                mapping:
                  fact: '#/components/schemas/FactMetricCreate'
                  sql: '#/components/schemas/SqlMetricCreate'
                  event_composition: '#/components/schemas/EventCompositionMetricCreate'
              title: Data
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricDefinitionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics/bulk-update:
    post:
      tags:
        - metrics-catalog
      summary: Bulk Update Metric Definitions
      operationId: >-
        bulk_update_metric_definitions_api_v1_projects__slug__metrics_bulk_update_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricDefinitionBulkUpdate'
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics/preview:
    post:
      tags:
        - metrics-catalog
      summary: Preview Metric Sql
      description: >-
        Stateless dry-run of a sql-kind metric SELECT (editor-gated).


        Validates the SQL with the same safety gate the worker uses and executes
        it

        against the data source over the last 50 buckets of the requested
        interval

        (hard-capped at 200 rows); nothing is persisted. Expected user mistakes
        —

        bad SQL, missing time/value columns, warehouse errors — return 200 with

        ``error`` set so the editor can render them inline. A data source this

        project may not use is a 404, whether the id is unknown or belongs to

        another project — the same status and sentence the fact-table doors
        answer.
      operationId: preview_metric_sql_api_v1_projects__slug__metrics_preview_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricPreviewRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricPreviewResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics/fact-preview:
    post:
      tags:
        - metrics-catalog
      summary: Preview Fact Operand
      description: >-
        Stateless dry-run of ONE fact operand's row filter (editor-gated).


        The body is the operand a save would send. Its filters are compiled by
        the

        worker's own resolver for the fact table's data-source dialect and the

        resulting query is executed with a 1-row cap over a bounded recent
        window;

        nothing is persisted. Expected user mistakes — an unknown named filter,
        SQL

        the warehouse rejects, a measure column the filtered query does not
        project —

        return 200 with ``error`` set so the filter editor can render them
        inline.

        An unknown project or fact table is a 404.
      operationId: preview_fact_operand_api_v1_projects__slug__metrics_fact_preview_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FactOperand'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FactOperandPreviewResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics/series-preview:
    post:
      tags:
        - metrics-catalog
      summary: Preview Metric Series
      description: >-
        Stateless dry-run of a fact or event-composition metric's series
        (editor-gated).


        The body is the definition a save would send. A fact metric is
        aggregated by

        the collector's own code over its last closed buckets (up to 50, capped
        at

        a month of wall clock); an event

        composition is composed from already-collected event counts on its
        newest

        scan grid. Nothing is persisted. Expected mistakes and warehouse errors

        return 200 with ``error`` set; an unknown fact table or data source is a

        404, an event outside the project a 422.
      operationId: preview_metric_series_api_v1_projects__slug__metrics_series_preview_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/FactMetricDefinition'
                - $ref: '#/components/schemas/EventCompositionMetricDefinition'
              discriminator:
                propertyName: kind
                mapping:
                  fact: '#/components/schemas/FactMetricDefinition'
                  event_composition: '#/components/schemas/EventCompositionMetricDefinition'
              title: Data
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricPreviewResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics/reorder:
    patch:
      tags:
        - metrics-catalog
      summary: Reorder Metric Definitions
      operationId: reorder_metric_definitions_api_v1_projects__slug__metrics_reorder_patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricDefinitionReorder'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MetricDefinitionResponse'
                title: >-
                  Response Reorder Metric Definitions Api V1 Projects  Slug 
                  Metrics Reorder Patch
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics/{metric_id}:
    get:
      tags:
        - metrics-catalog
      summary: Get Metric Definition
      operationId: get_metric_definition_api_v1_projects__slug__metrics__metric_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: metric_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Metric Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricDefinitionDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - metrics-catalog
      summary: Update Metric Definition
      operationId: >-
        update_metric_definition_api_v1_projects__slug__metrics__metric_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: metric_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Metric Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricDefinitionUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricDefinitionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - metrics-catalog
      summary: Delete Metric Definition
      operationId: >-
        delete_metric_definition_api_v1_projects__slug__metrics__metric_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: metric_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Metric Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics/{metric_id}/generated-sql:
    get:
      tags:
        - metrics-catalog
      summary: Get Metric Generated Sql
      description: >-
        Return a saved fact metric's primary dependency-batch SQL without
        running it.


        Same gate as ``GET /{metric_id}``: anyone who can read the metric. The
        SQL is

        compiled from config that read already returns and nothing executes.
      operationId: >-
        get_metric_generated_sql_api_v1_projects__slug__metrics__metric_id__generated_sql_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: metric_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Metric Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricGeneratedSqlResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics/{metric_id}/series:
    get:
      tags:
        - metrics-catalog
      summary: Get Metric Series
      operationId: get_metric_series_api_v1_projects__slug__metrics__metric_id__series_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: metric_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Metric Id
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricSeriesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics/{metric_id}/breakdowns:
    get:
      tags:
        - metrics-catalog
      summary: Get Metric Breakdowns
      operationId: >-
        get_metric_breakdowns_api_v1_projects__slug__metrics__metric_id__breakdowns_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: metric_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Metric Id
        - name: column
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Column
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricBreakdownsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics/{metric_id}/versions:
    get:
      tags:
        - metrics-catalog
      summary: Get Metric Version Series
      operationId: >-
        get_metric_version_series_api_v1_projects__slug__metrics__metric_id__versions_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: metric_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Metric Id
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricVersionSeriesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics/{metric_id}/collect:
    post:
      tags:
        - metrics-catalog
      summary: Collect Metric Now
      description: >-
        Trigger an immediate backfill collection from one metric (editor-gated).


        SQL/event-composition metrics dispatch alone. A fact metric refreshes
        every

        fact table reachable through its operands and recalculates all active
        fact

        metrics using those tables in shared batches (the clicked metric is
        included

        even when draft). Returns 202 once queued; warehouse queries run in
        workers.

        Unknown metric -> 404.
      operationId: >-
        collect_metric_now_api_v1_projects__slug__metrics__metric_id__collect_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: metric_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Metric Id
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricCollectNowResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/metrics/{metric_id}/move:
    patch:
      tags:
        - metrics-catalog
      summary: Move Metric Definition
      operationId: >-
        move_metric_definition_api_v1_projects__slug__metrics__metric_id__move_patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: metric_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Metric Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricDefinitionMove'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricDefinitionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/fact-tables:
    get:
      tags:
        - fact-tables
      summary: List Fact Tables
      operationId: list_fact_tables_api_v1_projects__slug__fact_tables_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Search
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 200
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FactTableListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - fact-tables
      summary: Create Fact Table
      operationId: create_fact_table_api_v1_projects__slug__fact_tables_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FactTableCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FactTableResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/fact-tables/preview:
    post:
      tags:
        - fact-tables
      summary: Preview Fact Table
      description: >-
        Read the column shape of a candidate fact-table SELECT (editor-gated).


        Reads the query's columns and identifier candidates; no rows are
        returned

        and nothing is persisted. The run is recorded in the audit log.
      operationId: preview_fact_table_api_v1_projects__slug__fact_tables_preview_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FactTablePreviewRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FactTablePreviewResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/fact-tables/{fact_table_id}:
    get:
      tags:
        - fact-tables
      summary: Get Fact Table
      operationId: get_fact_table_api_v1_projects__slug__fact_tables__fact_table_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: fact_table_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Fact Table Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FactTableResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - fact-tables
      summary: Update Fact Table
      operationId: >-
        update_fact_table_api_v1_projects__slug__fact_tables__fact_table_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: fact_table_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Fact Table Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FactTableUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FactTableResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - fact-tables
      summary: Delete Fact Table
      operationId: >-
        delete_fact_table_api_v1_projects__slug__fact_tables__fact_table_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: fact_table_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Fact Table Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs:
    get:
      tags:
        - docs
      summary: List Docs
      operationId: list_docs_api_v1_projects__slug__docs_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocTreeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/file:
    get:
      tags:
        - docs
      summary: Read Doc
      operationId: read_doc_api_v1_projects__slug__docs_file_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: path
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            description: The note's path, e.g. guides/setup.md
            title: Path
          description: The note's path, e.g. guides/setup.md
        - name: lang
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 64
              - type: 'null'
            description: >-
              Which language to read: a code such as `en` for that stored
              translation, `original` for the original, or nothing for the
              project's agent default (the original when that translation is
              missing or behind it).
            title: Lang
          description: >-
            Which language to read: a code such as `en` for that stored
            translation, `original` for the original, or nothing for the
            project's agent default (the original when that translation is
            missing or behind it).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocFileResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
        - docs
      summary: Write Doc
      operationId: write_doc_api_v1_projects__slug__docs_file_put
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: path
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            description: The note's path, e.g. guides/setup.md
            title: Path
          description: The note's path, e.g. guides/setup.md
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocWriteRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocWriteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - docs
      summary: Delete Doc
      operationId: delete_doc_api_v1_projects__slug__docs_file_delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: path
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            description: The note's path, e.g. guides/setup.md
            title: Path
          description: The note's path, e.g. guides/setup.md
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/file/sharing:
    get:
      tags:
        - docs
      summary: Read Doc Sharing
      description: Who the note is shared with. 404 for a note the caller cannot see.
      operationId: read_doc_sharing_api_v1_projects__slug__docs_file_sharing_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: path
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            description: The note's path, e.g. guides/setup.md
            title: Path
          description: The note's path, e.g. guides/setup.md
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocSharingResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
        - docs
      summary: Update Doc Sharing
      description: >-
        Change the note's visibility and shares: its author, or an org
        owner/admin.
      operationId: update_doc_sharing_api_v1_projects__slug__docs_file_sharing_put
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: path
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            description: The note's path, e.g. guides/setup.md
            title: Path
          description: The note's path, e.g. guides/setup.md
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocSharingUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocSharingResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/folder/sharing:
    get:
      tags:
        - docs
      summary: Read Folder Sharing
      description: >-
        A folder's setting, inherited by the notes under it that do not override
        it.
      operationId: read_folder_sharing_api_v1_projects__slug__docs_folder_sharing_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: path
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            description: A folder prefix.
            title: Path
          description: A folder prefix.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocSharingResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
        - docs
      summary: Update Folder Sharing
      description: >-
        Set (or, with ``inherited: true``, clear) a folder's visibility and
        shares.
      operationId: update_folder_sharing_api_v1_projects__slug__docs_folder_sharing_put
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: path
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            description: A folder prefix.
            title: Path
          description: A folder prefix.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocSharingUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocSharingResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/folder:
    delete:
      tags:
        - docs
      summary: Delete Doc Folder
      operationId: delete_doc_folder_api_v1_projects__slug__docs_folder_delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: path
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            description: A folder prefix.
            title: Path
          description: A folder prefix.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocFolderDeleteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/move:
    post:
      tags:
        - docs
      summary: Move Doc
      operationId: move_doc_api_v1_projects__slug__docs_move_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocMoveRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocMoveResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/revisions:
    get:
      tags:
        - docs
      summary: List Doc Revisions
      operationId: list_doc_revisions_api_v1_projects__slug__docs_revisions_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: path
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            description: The note's path, e.g. guides/setup.md
            title: Path
          description: The note's path, e.g. guides/setup.md
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocRevisionListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/revisions/{revision_id}:
    get:
      tags:
        - docs
      summary: Get Doc Revision
      operationId: get_doc_revision_api_v1_projects__slug__docs_revisions__revision_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: revision_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Revision Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocRevisionDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/revisions/{revision_id}/restore:
    post:
      tags:
        - docs
      summary: Restore Doc Revision
      operationId: >-
        restore_doc_revision_api_v1_projects__slug__docs_revisions__revision_id__restore_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: revision_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Revision Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocRestoreRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocWriteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/search:
    get:
      tags:
        - docs
      summary: Search Docs
      operationId: search_docs_api_v1_projects__slug__docs_search_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: q
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 500
            title: Q
        - name: scope
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - project
                  - organization
                type: string
              - type: 'null'
            title: Scope
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 50
            minimum: 1
            default: 20
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocSearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/backlinks:
    get:
      tags:
        - docs
      summary: Doc Backlinks
      description: |-
        Notes linking to ``kind:name`` that the caller can see.

        ``name`` is the entity's name, or its id for ``doc`` (the note's "Linked
        from"), ``alert_rule`` and ``user``.
      operationId: doc_backlinks_api_v1_projects__slug__docs_backlinks_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: kind
          in: query
          required: true
          schema:
            enum:
              - event
              - event_type
              - field
              - doc
              - variable
              - metric
              - alert_rule
              - branch
              - scan
              - data_source
              - user
            type: string
            title: Kind
        - name: name
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 500
            title: Name
        - name: qualifier
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 500
              - type: 'null'
            title: Qualifier
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocBacklinksResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/links:
    get:
      tags:
        - docs
      summary: Resolve Doc Links
      description: >-
        Resolve references as the caller reads them (a note they cannot see is
        ``unavailable``).
      operationId: resolve_doc_links_api_v1_projects__slug__docs_links_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: ref
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
            maxItems: 200
            description: >-
              kind:target (repeatable). kind is event, event-type, field, doc,
              variable, metric, alert-rule, branch, scan, data-source or user;
              doc, alert-rule and user take an id.
            title: Ref
          description: >-
            kind:target (repeatable). kind is event, event-type, field, doc,
            variable, metric, alert-rule, branch, scan, data-source or user;
            doc, alert-rule and user take an id.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DocLinkResolution'
                title: >-
                  Response Resolve Doc Links Api V1 Projects  Slug  Docs Links
                  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/link-suggestions:
    get:
      tags:
        - docs
      summary: Doc Link Suggestions
      description: >-
        The note editor's link and @mention picker.


        Candidates the caller may link to: notes they can see, members of the

        project's organization, and the project's plan entities, alert rules,

        branches, scans and data sources. ``insert`` is the reference text to
        put

        in the note. Rate-limited per user
        (``doc_link_suggestions_rate_limiter``).
      operationId: doc_link_suggestions_api_v1_projects__slug__docs_link_suggestions_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: q
          in: query
          required: false
          schema:
            type: string
            maxLength: 200
            default: ''
            title: Q
        - name: kind
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - event
                  - event_type
                  - field
                  - doc
                  - variable
                  - metric
                  - alert_rule
                  - branch
                  - scan
                  - data_source
                  - user
                type: string
              - type: 'null'
            description: Only this kind; the editor passes it once '[[kind:' is typed.
            title: Kind
          description: Only this kind; the editor passes it once '[[kind:' is typed.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 50
            minimum: 1
            default: 10
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocLinkSuggestionsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/export:
    get:
      tags:
        - docs
      summary: Export Docs
      operationId: export_docs_api_v1_projects__slug__docs_export_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: format
          in: query
          required: false
          schema:
            enum:
              - json
              - zip
            type: string
            default: json
            title: Format
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocBundle'
            application/zip: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/import:
    post:
      tags:
        - docs
      summary: Import Docs
      operationId: import_docs_api_v1_projects__slug__docs_import_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: mode
          in: query
          required: false
          schema:
            enum:
              - merge
              - mirror
            type: string
            default: merge
            title: Mode
        - name: dry_run
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Dry Run
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocImportRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocImportResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/import/zip:
    post:
      tags:
        - docs
      summary: Import Docs Zip
      operationId: import_docs_zip_api_v1_projects__slug__docs_import_zip_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: mode
          in: query
          required: false
          schema:
            enum:
              - merge
              - mirror
            type: string
            default: merge
            title: Mode
        - name: dry_run
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Dry Run
        - name: keep_root
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Keep Root
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/Body_import_docs_zip_api_v1_projects__slug__docs_import_zip_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocImportResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/translations:
    post:
      tags:
        - docs
      summary: Translate Doc
      description: >-
        Translate the note with the organization's AI model, once; the text is
        stored.


        ``language`` is a code or a name ("German", "немецкий"). The run happens
        in

        the background: the answer is ``pending``, and the note's
        ``translations``

        say when it is ``ready`` or ``failed``. A translation someone has edited
        is

        only replaced with ``overwrite`` (409 ``translation_edited`` otherwise).
      operationId: translate_doc_api_v1_projects__slug__docs_translations_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocTranslateRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocTranslationSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
        - docs
      summary: Write Doc Translation
      description: >-
        Save a translation's text by hand (creates it when the note has none in
        ``lang``).
      operationId: write_doc_translation_api_v1_projects__slug__docs_translations_put
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocTranslationWrite'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocTranslationSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - docs
      summary: Delete Doc Translation
      operationId: delete_doc_translation_api_v1_projects__slug__docs_translations_delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: path
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            description: The note's path, e.g. guides/setup.md
            title: Path
          description: The note's path, e.g. guides/setup.md
        - name: lang
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 64
            description: A translation's language, e.g. en
            title: Lang
          description: A translation's language, e.g. en
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/translations/revisions:
    get:
      tags:
        - docs
      summary: List Doc Translation Revisions
      operationId: >-
        list_doc_translation_revisions_api_v1_projects__slug__docs_translations_revisions_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: path
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            description: The note's path, e.g. guides/setup.md
            title: Path
          description: The note's path, e.g. guides/setup.md
        - name: lang
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 64
            description: A translation's language, e.g. en
            title: Lang
          description: A translation's language, e.g. en
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DocTranslationRevisionSummary'
                title: >-
                  Response List Doc Translation Revisions Api V1 Projects  Slug 
                  Docs Translations Revisions Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/translations/revisions/{revision_id}:
    get:
      tags:
        - docs
      summary: Get Doc Translation Revision
      operationId: >-
        get_doc_translation_revision_api_v1_projects__slug__docs_translations_revisions__revision_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: revision_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Revision Id
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: path
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            description: The note's path, e.g. guides/setup.md
            title: Path
          description: The note's path, e.g. guides/setup.md
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocTranslationRevisionDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/translations/revisions/{revision_id}/restore:
    post:
      tags:
        - docs
      summary: Restore Doc Translation Revision
      operationId: >-
        restore_doc_translation_revision_api_v1_projects__slug__docs_translations_revisions__revision_id__restore_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: revision_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Revision Id
        - name: scope
          in: query
          required: true
          schema:
            enum:
              - project
              - organization
            type: string
            description: 'Whose notes: the project''s or its organization''s.'
            title: Scope
          description: 'Whose notes: the project''s or its organization''s.'
        - name: path
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 1024
            description: The note's path, e.g. guides/setup.md
            title: Path
          description: The note's path, e.g. guides/setup.md
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocTranslationSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/docs/languages:
    get:
      tags:
        - docs
      summary: Get Doc Languages
      description: >-
        The project's default languages: what agents get, and what the app opens
        for people.
      operationId: get_doc_languages_api_v1_projects__slug__docs_languages_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocLanguageDefaults'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
        - docs
      summary: Update Doc Languages
      description: >-
        Set both defaults: a code or a name each, empty or null for the
        original.
      operationId: update_doc_languages_api_v1_projects__slug__docs_languages_put
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocLanguageDefaultsUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocLanguageDefaults'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/annotations:
    get:
      tags:
        - chart-annotations
      summary: List Chart Annotations
      operationId: list_chart_annotations_api_v1_projects__slug__annotations_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/ChartAnnotationScopeType'
              - type: 'null'
            title: Scope Type
        - name: scope_ref
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Scope Ref
        - name: time_from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Time From
        - name: time_to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Time To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ChartAnnotationResponse'
                title: >-
                  Response List Chart Annotations Api V1 Projects  Slug 
                  Annotations Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - chart-annotations
      summary: Create Chart Annotation
      operationId: create_chart_annotation_api_v1_projects__slug__annotations_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChartAnnotationCreate'
      responses:
        '200':
          description: >-
            A source=api annotation with the same label was already created in
            this project within the last 24 hours; it is returned instead of a
            duplicate. Manual annotations are never de-duplicated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChartAnnotationResponse'
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChartAnnotationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/annotations/{annotation_id}:
    delete:
      tags:
        - chart-annotations
      summary: Delete Chart Annotation
      operationId: >-
        delete_chart_annotation_api_v1_projects__slug__annotations__annotation_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: annotation_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Annotation Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/planned-events:
    get:
      tags:
        - planned-events
      summary: List Planned Events
      operationId: list_planned_events_api_v1_projects__slug__planned_events_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: scope_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/ChartAnnotationScopeType'
              - type: 'null'
            title: Scope Type
        - name: scope_ref
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Scope Ref
        - name: time_from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Time From
        - name: time_to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Time To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PlannedEventResponse'
                title: >-
                  Response List Planned Events Api V1 Projects  Slug  Planned
                  Events Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - planned-events
      summary: Create Planned Event
      operationId: create_planned_event_api_v1_projects__slug__planned_events_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlannedEventCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlannedEventResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/planned-events/suggestions:
    get:
      tags:
        - planned-events
      summary: List Planned Window Suggestions
      description: >-
        Recurring windows the project's ``expected`` verdicts point at (#271).


        Accepting one is creating its ``windows`` as planned events; it then
        drops

        out of this list.
      operationId: >-
        list_planned_window_suggestions_api_v1_projects__slug__planned_events_suggestions_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PlannedWindowSuggestionResponse'
                title: >-
                  Response List Planned Window Suggestions Api V1 Projects 
                  Slug  Planned Events Suggestions Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/planned-events/{planned_event_id}:
    patch:
      tags:
        - planned-events
      summary: Update Planned Event
      operationId: >-
        update_planned_event_api_v1_projects__slug__planned_events__planned_event_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: planned_event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Planned Event Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlannedEventUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlannedEventResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - planned-events
      summary: Delete Planned Event
      operationId: >-
        delete_planned_event_api_v1_projects__slug__planned_events__planned_event_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: planned_event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Planned Event Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches:
    get:
      tags:
        - plan-branches
      summary: List Branches
      description: >-
        List a project's branches.


        ``include_diff_counts`` fills ``ahead`` / ``behind_base`` for each open

        feature branch (draft, ready_for_review, changes_requested, approved)
        from a

        single shared main snapshot, so a branches list does not need one

        ``/branches/{id}/diff`` call per row. Merged and closed branches keep
        both

        null, like main. It is opt-in because it costs one plan snapshot per
        open

        branch plus one for main; leave it off when you only need the branch
        rows.
      operationId: list_branches_api_v1_projects__slug__branches_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: include_diff_counts
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Include Diff Counts
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanBranchList'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - plan-branches
      summary: Create Branch
      operationId: create_branch_api_v1_projects__slug__branches_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlanBranchCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanBranchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}:
    get:
      tags:
        - plan-branches
      summary: Get Branch
      operationId: get_branch_api_v1_projects__slug__branches__branch_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanBranchDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - plan-branches
      summary: Delete Branch
      operationId: delete_branch_api_v1_projects__slug__branches__branch_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/transition:
    post:
      tags:
        - plan-branches
      summary: Transition Branch
      operationId: >-
        transition_branch_api_v1_projects__slug__branches__branch_id__transition_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BranchTransitionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanBranchDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/reviewers:
    post:
      tags:
        - plan-branches
      summary: Add Reviewer
      operationId: add_reviewer_api_v1_projects__slug__branches__branch_id__reviewers_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BranchReviewerCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BranchReviewerResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/reviewers/{user_id}:
    delete:
      tags:
        - plan-branches
      summary: Remove Reviewer
      operationId: >-
        remove_reviewer_api_v1_projects__slug__branches__branch_id__reviewers__user_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/comments:
    get:
      tags:
        - plan-branches
      summary: List Comments
      operationId: list_comments_api_v1_projects__slug__branches__branch_id__comments_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BranchCommentResponse'
                title: >-
                  Response List Comments Api V1 Projects  Slug  Branches  Branch
                  Id  Comments Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - plan-branches
      summary: Create Comment
      operationId: create_comment_api_v1_projects__slug__branches__branch_id__comments_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BranchCommentCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BranchCommentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/comments/{comment_id}:
    delete:
      tags:
        - plan-branches
      summary: Delete Comment
      operationId: >-
        delete_comment_api_v1_projects__slug__branches__branch_id__comments__comment_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
        - name: comment_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Comment Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/diff:
    get:
      tags:
        - plan-branches
      summary: Diff Branch
      operationId: diff_branch_api_v1_projects__slug__branches__branch_id__diff_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanBranchDiff'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/revert:
    post:
      tags:
        - plan-branches
      summary: Revert Branch Change
      operationId: >-
        revert_branch_change_api_v1_projects__slug__branches__branch_id__revert_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BranchRevertRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanBranchDiff'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/conflicts:
    get:
      tags:
        - plan-branches
      summary: Get Branch Conflicts
      operationId: >-
        get_branch_conflicts_api_v1_projects__slug__branches__branch_id__conflicts_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BranchConflictsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/update-from-main:
    get:
      tags:
        - plan-branches
      summary: Preview Update From Main
      description: >-
        What "Update from main" would bring onto the branch, and what overlaps.


        Read-only. ``main_hash`` is main as this preview read it; send it back
        as

        ``expected_main_hash`` so the update refuses (409 ``main_moved``) rather

        than apply changes nobody reviewed.
      operationId: >-
        preview_update_from_main_api_v1_projects__slug__branches__branch_id__update_from_main_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateFromMainPreview'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - plan-branches
      summary: Update From Main
      description: >-
        Three-way merge main INTO the branch; the branch's base becomes main.


        Every field both sides changed needs a choice — ``ours`` takes main's

        value, ``theirs`` keeps the branch's — given inline in ``resolutions``
        or

        saved earlier through ``/resolutions`` (stored choices count only when

        ``expected_main_hash`` is sent). Refusals, all 409 and all writing

        nothing: ``unresolved_conflicts`` (with the full ``conflicts`` list),

        ``update_blocked`` (the preview's ``blockers``), ``main_moved``,

        ``incomplete_base_snapshot``, ``update_constraint_violation``, and a
        merged

        or closed branch. A branch already level with main answers 200

        with ``updated: false``.
      operationId: >-
        update_from_main_api_v1_projects__slug__branches__branch_id__update_from_main_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateFromMainRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateFromMainResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/resolutions:
    post:
      tags:
        - plan-branches
      summary: Save Branch Resolution
      operationId: >-
        save_branch_resolution_api_v1_projects__slug__branches__branch_id__resolutions_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResolutionCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResolutionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/resolutions/{resolution_id}:
    delete:
      tags:
        - plan-branches
      summary: Delete Branch Resolution
      operationId: >-
        delete_branch_resolution_api_v1_projects__slug__branches__branch_id__resolutions__resolution_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
        - name: resolution_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Resolution Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/merge:
    post:
      tags:
        - plan-branches
      summary: Merge Branch
      operationId: merge_branch_api_v1_projects__slug__branches__branch_id__merge_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanBranchDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/dependencies:
    get:
      tags:
        - dependencies
      summary: Get Dependencies
      description: |-
        Upstream and downstream edges of one entity, on ``?branch=`` or main.

        An id that no longer resolves answers ``entity.exists = false`` with any
        project-wide rows that still name it, rather than 404.
      operationId: get_dependencies_api_v1_projects__slug__dependencies_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: entity
          in: query
          required: true
          schema:
            type: string
            maxLength: 64
            description: >-
              The entity to explain, as '<kind>:<uuid>' with kind one of event,
              event_type, field, variable, metric, fact_table, alert_rule,
              relation.
            title: Entity
          description: >-
            The entity to explain, as '<kind>:<uuid>' with kind one of event,
            event_type, field, variable, metric, fact_table, alert_rule,
            relation.
        - name: depth
          in: query
          required: false
          schema:
            type: integer
            maximum: 2
            minimum: 1
            default: 1
            title: Depth
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DependenciesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/impact:
    post:
      tags:
        - dependencies
      summary: Post Impact
      description: >-
        What each planned delete / deprecate / rename would affect. Changes
        nothing.


        Always one hop: ``depth`` in the body is accepted for compatibility and

        ignored (use ``GET /dependencies?depth=2`` to walk further).
      operationId: post_impact_api_v1_projects__slug__impact_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImpactRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImpactResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/impact:
    get:
      tags:
        - dependencies
      summary: Get Branch Impact
      description: The downstream objects a working branch's changes touch, from its diff.
      operationId: get_branch_impact_api_v1_projects__slug__branches__branch_id__impact_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImpactResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/branches/{branch_id}/implementation-tickets:
    get:
      tags:
        - implementation-tickets
      summary: List Branch Implementation Tickets
      description: >-
        Read-only: tickets are opened by the merge worker, never by a client.


        Auth matches the other branch reads — any authenticated project reader,
        via

        the router-level ``get_current_user`` dependency; no editor gate,
        because

        nothing here mutates.
      operationId: >-
        list_branch_implementation_tickets_api_v1_projects__slug__branches__branch_id__implementation_tickets_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Branch Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ImplementationTicketResponse'
                title: >-
                  Response List Branch Implementation Tickets Api V1 Projects 
                  Slug  Branches  Branch Id  Implementation Tickets Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/events/{event_id}/implementation-tickets:
    get:
      tags:
        - implementation-tickets
      summary: List Event Implementation Tickets
      description: >-
        The tickets that named this event, across every branch that merged.


        Shows history; it does not replace the editable meta field. Rows only
        exist

        where the Jira integration is enabled and a branch has merged.
      operationId: >-
        list_event_implementation_tickets_api_v1_projects__slug__events__event_id__implementation_tickets_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Event Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ImplementationTicketResponse'
                title: >-
                  Response List Event Implementation Tickets Api V1 Projects 
                  Slug  Events  Event Id  Implementation Tickets Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/revisions:
    post:
      tags:
        - plan-revisions
      summary: Create Revision
      operationId: create_revision_api_v1_projects__slug__revisions_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlanRevisionCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanRevisionDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
        - plan-revisions
      summary: List Revisions
      operationId: list_revisions_api_v1_projects__slug__revisions_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 50
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanRevisionList'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/revisions/{revision_id}:
    get:
      tags:
        - plan-revisions
      summary: Get Revision
      operationId: get_revision_api_v1_projects__slug__revisions__revision_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: revision_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Revision Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanRevisionDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/revisions/{revision_id}/diff:
    get:
      tags:
        - plan-revisions
      summary: Diff Revision
      operationId: diff_revision_api_v1_projects__slug__revisions__revision_id__diff_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: revision_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Revision Id
        - name: compare_to
          in: query
          required: true
          schema:
            type: string
            format: uuid
            title: Compare To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanDiff'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/plan/validate:
    post:
      tags:
        - plan-validation
      summary: Validate Plan
      description: >-
        One verdict per tracking call: known event, allowed values, contracts.


        Up to 5000 items per request. A ``null`` field value means "set at
        runtime"

        and is never an error. Changes nothing.
      operationId: validate_plan_api_v1_projects__slug__plan_validate_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PlanValidationRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlanValidationResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/plan/export:
    get:
      tags:
        - plan-export
      summary: Export Plan
      description: >-
        The plan of main (or ``?branch=``) as a schema bundle or a codegen
        model.


        Deterministic: the same plan exports byte-identical, with the plan

        revision, the branch and a content hash. Changes nothing.
      operationId: export_plan_api_v1_projects__slug__plan_export_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: format
          in: query
          required: false
          schema:
            enum:
              - jsonschema
              - codegen_model
            type: string
            description: >-
              ``jsonschema``: one JSON Schema (draft 2020-12) per event.
              ``codegen_model``: the plan shaped for ``tripl codegen``.
            default: jsonschema
            title: Format
          description: >-
            ``jsonschema``: one JSON Schema (draft 2020-12) per event.
            ``codegen_model``: the plan shaped for ``tripl codegen``.
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PlanExportJsonSchemaBundle'
                  - $ref: '#/components/schemas/PlanExportCodegenModel'
                title: Response Export Plan Api V1 Projects  Slug  Plan Export Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/reconciliation/shadow-events:
    get:
      tags:
        - reconciliation
      summary: List Shadow Events
      operationId: >-
        list_shadow_events_api_v1_projects__slug__reconciliation_shadow_events_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/ShadowEventStatus'
              - type: 'null'
            title: Status
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 500
            minimum: 1
            default: 100
            title: Limit
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShadowEventListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/reconciliation/shadow-events/{candidate_id}/accept:
    post:
      tags:
        - reconciliation
      summary: Accept Shadow Event
      operationId: >-
        accept_shadow_event_api_v1_projects__slug__reconciliation_shadow_events__candidate_id__accept_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: candidate_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Candidate Id
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShadowEventAcceptRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShadowEventAcceptResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/reconciliation/shadow-events/{candidate_id}/dismiss:
    post:
      tags:
        - reconciliation
      summary: Dismiss Shadow Event
      operationId: >-
        dismiss_shadow_event_api_v1_projects__slug__reconciliation_shadow_events__candidate_id__dismiss_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: candidate_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Candidate Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShadowEventDismissResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/reconciliation/shadow-events/batch:
    post:
      tags:
        - reconciliation
      summary: Batch Shadow Events
      description: |-
        Accept or dismiss many inbox rows in one request.

        Each row is handled and audited exactly as its single route would, and a
        refused row is reported in ``results`` without stopping the rest.
      operationId: >-
        batch_shadow_events_api_v1_projects__slug__reconciliation_shadow_events_batch_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShadowEventBatchRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShadowEventBatchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/reconciliation/dead-events:
    get:
      tags:
        - reconciliation
      summary: List Dead Events
      operationId: list_dead_events_api_v1_projects__slug__reconciliation_dead_events_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: days
          in: query
          required: false
          schema:
            type: integer
            maximum: 365
            minimum: 1
            default: 30
            title: Days
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeadEventListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/reconciliation/dead-events/archive:
    post:
      tags:
        - reconciliation
      summary: Archive Dead Events
      operationId: >-
        archive_dead_events_api_v1_projects__slug__reconciliation_dead_events_archive_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeadEventArchiveRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeadEventArchiveResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/reconciliation/coverage:
    get:
      tags:
        - reconciliation
      summary: Get Coverage
      operationId: get_coverage_api_v1_projects__slug__reconciliation_coverage_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: days
          in: query
          required: false
          schema:
            type: integer
            maximum: 180
            minimum: 1
            default: 14
            title: Days
        - name: scan_config_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Scan Config Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoverageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/duplicates:
    get:
      tags:
        - duplicates
      summary: List Duplicate Clusters
      description: >-
        Clusters of existing events that look like one event spelled several
        ways.
      operationId: list_duplicate_clusters_api_v1_projects__slug__duplicates_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cursor
        - name: branch
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Plan branch id (UUID) to read and write instead of the main
              branch.
            title: Branch
          description: Plan branch id (UUID) to read and write instead of the main branch.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DuplicateClusterPage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/duplicates/dismiss:
    post:
      tags:
        - duplicates
      summary: Dismiss Duplicate Pair
      description: Mark two events as not duplicates; the pair is never clustered again.
      operationId: dismiss_duplicate_pair_api_v1_projects__slug__duplicates_dismiss_post
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DuplicateDismissRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DuplicateDismissResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/audit:
    get:
      tags:
        - audit
      summary: List Project Audit
      description: |-
        The project's entries, newest first. A deleted project's rows stay
        reachable by its last slug while no live project answers to it.
      operationId: list_project_audit_api_v1_projects__slug__audit_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: action
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Action
        - name: user_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: User Id
        - name: user_email
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: User Email
        - name: since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Since
        - name: until
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Until
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 50
            title: Limit
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/audit/actions:
    get:
      tags:
        - audit
      summary: List Project Audit Actions
      description: |-
        Every action the log records, grouped for the filter; see audit_actions.
        A project's entries carry the ``project`` group's actions.
      operationId: list_project_audit_actions_api_v1_projects__slug__audit_actions_get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditActionCatalog'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/audit/{entry_id}:
    get:
      tags:
        - audit
      summary: Get Project Audit Entry
      description: One entry with its payload. 404 for an entry of another project.
      operationId: get_project_audit_entry_api_v1_projects__slug__audit__entry_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: entry_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Entry Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditEntryDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/users/invitations:
    get:
      tags:
        - users
      summary: List Invitations
      description: >-
        Outstanding invitations into the organization: the roster of pending
        access.
      operationId: list_invitations_api_v1_users_invitations_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/InvitationResponse'
                type: array
                title: Response List Invitations Api V1 Users Invitations Get
    post:
      tags:
        - users
      summary: Create Invitation
      description: >-
        Invite one person into the request's organization, at an organization
        role.


        ``OwnerUserDep`` is org owner/admin-only AND rejects API keys of any
        scope, so

        minting an account always requires an interactive session — an
        automation

        token can never conjure a new identity. Inviting at ``owner`` takes an

        owner: an admin cannot mint an account more privileged than their own.


        The redeem link is returned in the body, not merely emailed: SMTP is

        optional and unconfigured on many instances, so a body-only path is the
        one

        that always works. It appears here and nowhere else. When the operator
        has

        SMTP configured the link is also mailed, through the operator's relay
        (never

        an organization's), after the response.


        On a public demo the link is the only delivery: no mail is prepared or

        sent. Only the member organization role is allowed, with at most ten

        members plus unexpired pending invitations (409 when full), and ten
        mints

        per rolling hour per organization and inviter (429 when exhausted).


        The invitation belongs to the organization the request acts in: the one
        an

        ``/orgs/{org}/users/invitations`` URL names, else the legacy default.
      operationId: create_invitation_api_v1_users_invitations_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvitationCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvitationCreatedResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/users/invitations/{invitation_id}:
    delete:
      tags:
        - users
      summary: Revoke Invitation
      description: >-
        Revoke an invitation into the organization; its link stops working
        immediately.
      operationId: revoke_invitation_api_v1_users_invitations__invitation_id__delete
      parameters:
        - name: invitation_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Invitation Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/users:
    get:
      tags:
        - users
      summary: List Users
      description: |-
        The members of the request's organization with their organization role.

        Any member may see the roster (it feeds the member pickers); a signed-in
        account outside the organization gets 403.
      operationId: list_users_api_v1_users_get
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 200
            title: Limit
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserListItem'
                title: Response List Users Api V1 Users Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/users/{user_id}:
    patch:
      tags:
        - users
      summary: Update User Role
      description: >-
        Change a member's ORGANIZATION role (owner | admin | member).


        404 for an account outside the organization, 400 when it would leave the

        organization without an owner, 403 when an admin tries to make or unmake
        an

        owner. The member stays signed in; the new role applies from their next

        request.
      operationId: update_user_role_api_v1_users__user_id__patch
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserRoleUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserListItem'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/me/api-keys:
    get:
      tags:
        - api-keys
      summary: List Api Keys
      operationId: list_api_keys_api_v1_me_api_keys_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ApiKeyResponse'
                type: array
                title: Response List Api Keys Api V1 Me Api Keys Get
    post:
      tags:
        - api-keys
      summary: Create Api Key
      operationId: create_api_key_api_v1_me_api_keys_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/me/api-keys/{key_id}:
    delete:
      tags:
        - api-keys
      summary: Revoke Api Key
      operationId: revoke_api_key_api_v1_me_api_keys__key_id__delete
      parameters:
        - name: key_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Key Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/me/notifications:
    get:
      tags:
        - notifications
      summary: List My Notifications
      operationId: list_my_notifications_api_v1_me_notifications_get
      parameters:
        - name: unread
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Unread
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 30
            title: Limit
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 200
              - type: 'null'
            title: Cursor
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationPage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/me/notifications/unread-count:
    get:
      tags:
        - notifications
      summary: My Unread Count
      operationId: my_unread_count_api_v1_me_notifications_unread_count_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnreadCountResponse'
  /api/v1/me/notifications/read:
    post:
      tags:
        - notifications
      summary: Mark My Notifications Read
      operationId: mark_my_notifications_read_api_v1_me_notifications_read_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MarkReadRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarkReadResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/me/notification-prefs:
    get:
      tags:
        - notifications
      summary: Get My Notification Prefs
      operationId: get_my_notification_prefs_api_v1_me_notification_prefs_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationPrefsResponse'
    patch:
      tags:
        - notifications
      summary: Update My Notification Prefs
      operationId: update_my_notification_prefs_api_v1_me_notification_prefs_patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationPrefsUpdate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationPrefsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/projects/{slug}/subscriptions/{entity_type}/{entity_id}:
    get:
      tags:
        - notifications
      summary: Get My Subscription
      operationId: >-
        get_my_subscription_api_v1_projects__slug__subscriptions__entity_type___entity_id__get
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: entity_type
          in: path
          required: true
          schema:
            enum:
              - event
              - event_type
              - metric
              - branch
            type: string
            title: Entity Type
        - name: entity_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Entity Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionState'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
        - notifications
      summary: Watch Entity
      operationId: >-
        watch_entity_api_v1_projects__slug__subscriptions__entity_type___entity_id__put
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: entity_type
          in: path
          required: true
          schema:
            enum:
              - event
              - event_type
              - metric
              - branch
            type: string
            title: Entity Type
        - name: entity_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Entity Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionState'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - notifications
      summary: Unwatch Entity
      operationId: >-
        unwatch_entity_api_v1_projects__slug__subscriptions__entity_type___entity_id__delete
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: entity_type
          in: path
          required: true
          schema:
            enum:
              - event
              - event_type
              - metric
              - branch
            type: string
            title: Entity Type
        - name: entity_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Entity Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionState'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - notifications
      summary: Mute Entity
      operationId: >-
        mute_entity_api_v1_projects__slug__subscriptions__entity_type___entity_id__patch
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: entity_type
          in: path
          required: true
          schema:
            enum:
              - event
              - event_type
              - metric
              - branch
            type: string
            title: Entity Type
        - name: entity_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Entity Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionMuteRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionState'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/orgs:
    get:
      tags:
        - organizations
      summary: List Orgs
      description: >-
        The organizations the caller belongs to, with their role in each.


        An API key belongs to one organization and lists only that one. A

        suspended organization is listed with its ``status`` (F20 PR14). A
        platform

        admin's browser session also lists the organizations they have a live

        read-only step-in to, flagged ``step_in``.
      operationId: list_orgs_api_v1_orgs_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/OrgResponse'
                type: array
                title: Response List Orgs Api V1 Orgs Get
    post:
      tags:
        - organizations
      summary: Create Org
      description: Create an organization; its creator becomes its owner.
      operationId: create_org_api_v1_orgs_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/orgs/{org}:
    get:
      tags:
        - organizations
      summary: Get Org
      operationId: get_org_api_v1_orgs__org__get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgResponse'
    delete:
      tags:
        - organizations
      summary: Delete Org
      description: >-
        Start deleting the organization: 202, then a background job purges it.


        The body must repeat the slug (``{"confirm_slug": "<slug>"}``). The
        default

        organization cannot be deleted. From this response on the organization

        answers 404 everywhere.
      operationId: delete_org_api_v1_orgs__org__delete
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgDeleteRequest'
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - organizations
      summary: Update Org
      description: >-
        Rename the organization and/or set its default project role.


        The slug is permanent: a ``slug`` in the body is a 422, and so is a

        ``default_project_role`` of ``owner``. Audited as ``org.update`` with
        the

        changed fields before and after.
      operationId: update_org_api_v1_orgs__org__patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgUpdate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/orgs/{org}/members:
    get:
      tags:
        - organizations
      summary: List Members
      operationId: list_members_api_v1_orgs__org__members_get
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 200
            title: Limit
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UserListItem'
                title: Response List Members Api V1 Orgs  Org  Members Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/orgs/{org}/members/{user_id}:
    patch:
      tags:
        - organizations
      summary: Update Member Role
      description: Change a member's organization role (owner | admin | member).
      operationId: update_member_role_api_v1_orgs__org__members__user_id__patch
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserRoleUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserListItem'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - organizations
      summary: Remove Member
      description: >-
        Remove a member: their membership, project rows, keys and pending
        invitations here.
      operationId: remove_member_api_v1_orgs__org__members__user_id__delete
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgMemberRemoved'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/orgs/{org}/transfer-ownership:
    post:
      tags:
        - organizations
      summary: Transfer Ownership
      description: Make another member an owner and step the caller down to admin.
      operationId: transfer_ownership_api_v1_orgs__org__transfer_ownership_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgTransferOwnership'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserListItem'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/orgs/{org}/settings:
    get:
      tags:
        - organizations
      summary: Get Org Settings
      operationId: get_org_settings_api_v1_orgs__org__settings_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgSettingsResponse'
    put:
      tags:
        - organizations
      summary: Put Org Settings
      description: 'Identical to PATCH: a sparse override map, unset fields left untouched.'
      operationId: put_org_settings_api_v1_orgs__org__settings_put
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgSettingsUpdate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgSettingsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - organizations
      summary: Patch Org Settings
      operationId: patch_org_settings_api_v1_orgs__org__settings_patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgSettingsUpdate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgSettingsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/orgs/{org}/settings/row-limits:
    get:
      tags:
        - organizations
      summary: Get Org Row Limits
      description: The organization's effective row caps, readable by every member.
      operationId: get_org_row_limits_api_v1_orgs__org__settings_row_limits_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RowLimitDefaultsResponse'
  /api/v1/orgs/{org}/settings/photo-limits:
    get:
      tags:
        - organizations
      summary: Get Org Photo Limits
      description: >-
        The organization's photo upload limits (F20 PR11), readable by every
        member.
      operationId: get_org_photo_limits_api_v1_orgs__org__settings_photo_limits_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhotoLimitsResponse'
  /api/v1/orgs/{org}/settings/ai/test:
    post:
      tags:
        - organizations
      summary: Test Org Ai Settings
      description: >-
        Probe the AI provider THIS organization would use, with its saved
        values.
      operationId: test_org_ai_settings_api_v1_orgs__org__settings_ai_test_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AiSettingsTestRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SettingsTestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/orgs/{org}/settings/email/test:
    post:
      tags:
        - organizations
      summary: Test Org Email Settings
      description: Send one probe through THIS organization's relay; always 200.
      operationId: test_org_email_settings_api_v1_orgs__org__settings_email_test_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailSettingsTestRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SettingsTestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/orgs/{org}/settings/trackers:
    get:
      tags:
        - organizations
      summary: Get Org Tracker Defaults
      description: >-
        The organization's Jira/Linear defaults (F20 PR12); secrets as
        ``*_configured``.
      operationId: get_org_tracker_defaults_api_v1_orgs__org__settings_trackers_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgTrackerDefaultsResponse'
    patch:
      tags:
        - organizations
      summary: Patch Org Tracker Defaults
      description: Set or clear (``null`` / ``""``) the organization's tracker defaults.
      operationId: patch_org_tracker_defaults_api_v1_orgs__org__settings_trackers_patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgTrackerDefaultsUpdate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgTrackerDefaultsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/orgs/{org}/groups:
    get:
      tags:
        - organizations
      summary: List Groups
      operationId: list_groups_api_v1_orgs__org__groups_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/OrgGroupResponse'
                type: array
                title: Response List Groups Api V1 Orgs  Org  Groups Get
    post:
      tags:
        - organizations
      summary: Create Group
      operationId: create_group_api_v1_orgs__org__groups_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgGroupCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgGroupDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/orgs/{org}/groups/{group_id}:
    get:
      tags:
        - organizations
      summary: Get Group
      operationId: get_group_api_v1_orgs__org__groups__group_id__get
      parameters:
        - name: group_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Group Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgGroupDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - organizations
      summary: Update Group
      description: Rename the group and/or change its description.
      operationId: update_group_api_v1_orgs__org__groups__group_id__patch
      parameters:
        - name: group_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Group Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgGroupUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgGroupDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - organizations
      summary: Delete Group
      operationId: delete_group_api_v1_orgs__org__groups__group_id__delete
      parameters:
        - name: group_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Group Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/orgs/{org}/groups/{group_id}/members:
    post:
      tags:
        - organizations
      summary: Add Group Member
      description: Add a member of the organization to the group.
      operationId: add_group_member_api_v1_orgs__org__groups__group_id__members_post
      parameters:
        - name: group_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Group Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrgGroupMemberAdd'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgGroupMemberResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/orgs/{org}/groups/{group_id}/members/{user_id}:
    delete:
      tags:
        - organizations
      summary: Remove Group Member
      operationId: >-
        remove_group_member_api_v1_orgs__org__groups__group_id__members__user_id__delete
      parameters:
        - name: group_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Group Id
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/platform/settings:
    get:
      tags:
        - platform
      summary: Get Platform Settings
      operationId: get_platform_settings_api_v1_platform_settings_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceSettingsResponse'
    patch:
      tags:
        - platform
      summary: Patch Platform Settings
      operationId: patch_platform_settings_api_v1_platform_settings_patch
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceSettingsUpdate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceSettingsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/platform/settings/ai/test:
    post:
      tags:
        - platform
      summary: Test Platform Ai Settings
      description: Probe the operator's AI provider (what organizations inherit).
      operationId: test_platform_ai_settings_api_v1_platform_settings_ai_test_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AiSettingsTestRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SettingsTestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/platform/settings/email/test:
    post:
      tags:
        - platform
      summary: Test Platform Email Settings
      description: 'Send one probe through the operator''s relay: the one account mail uses.'
      operationId: test_platform_email_settings_api_v1_platform_settings_email_test_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailSettingsTestRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SettingsTestResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/platform/settings/telemetry:
    get:
      tags:
        - platform
      summary: Get Telemetry
      description: >-
        The opt-in usage ping: whether it is sent, where to, and exactly what it
        last held.
      operationId: get_telemetry_api_v1_platform_settings_telemetry_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelemetryStatusResponse'
components:
  schemas:
    ActiveSignalsQuery:
      properties:
        event_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Event Ids
          default: []
      type: object
      title: ActiveSignalsQuery
    ActiveStepInOut:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        org_slug:
          type: string
          title: Org Slug
        expires_at:
          type: string
          format: date-time
          title: Expires At
      type: object
      required:
        - id
        - org_slug
        - expires_at
      title: ActiveStepInOut
      description: A platform admin's live read-only step-in (F20 PR14), for the UI banner.
    ActivityItemResponse:
      properties:
        id:
          type: string
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        project_slug:
          type: string
          title: Project Slug
        project_name:
          type: string
          title: Project Name
        type:
          type: string
          enum:
            - anomaly
            - scan
            - alert
            - event
          title: Type
        severity:
          type: string
          enum:
            - high
            - medium
            - low
          title: Severity
        title:
          type: string
          title: Title
        detail:
          type: string
          title: Detail
        occurred_at:
          type: string
          format: date-time
          title: Occurred At
        target_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Path
      type: object
      required:
        - id
        - project_id
        - project_slug
        - project_name
        - type
        - severity
        - title
        - detail
        - occurred_at
      title: ActivityItemResponse
    AiAskRequest:
      properties:
        question:
          type: string
          maxLength: 500
          minLength: 3
          title: Question
      type: object
      required:
        - question
      title: AiAskRequest
    AiAskResponse:
      properties:
        answer:
          type: string
          title: Answer
        sources:
          items:
            $ref: '#/components/schemas/AiAskSource'
          type: array
          title: Sources
        semantic_used:
          type: boolean
          title: Semantic Used
      type: object
      required:
        - answer
        - sources
        - semantic_used
      title: AiAskResponse
    AiAskSource:
      properties:
        title:
          type: string
          title: Title
        entity_type:
          type: string
          title: Entity Type
        route_path:
          type: string
          title: Route Path
      type: object
      required:
        - title
        - entity_type
        - route_path
      title: AiAskSource
    AiDescribeEventRequest:
      properties:
        event_id:
          type: string
          format: uuid
          title: Event Id
      type: object
      required:
        - event_id
      title: AiDescribeEventRequest
    AiDescribeEventTypeRequest:
      properties:
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
      type: object
      required:
        - event_type_id
      title: AiDescribeEventTypeRequest
    AiDescribeResponse:
      properties:
        description:
          type: string
          title: Description
        field_suggestions:
          items:
            $ref: '#/components/schemas/AiFieldSuggestion'
          type: array
          title: Field Suggestions
      type: object
      required:
        - description
        - field_suggestions
      title: AiDescribeResponse
    AiFieldSuggestion:
      properties:
        field_name:
          type: string
          title: Field Name
        description:
          type: string
          title: Description
      type: object
      required:
        - field_name
        - description
      title: AiFieldSuggestion
    AiPromptDefaultsResponse:
      properties:
        describe_system_prompt:
          type: string
          title: Describe System Prompt
        ask_system_prompt:
          type: string
          title: Ask System Prompt
        alert_explanation_system_prompt:
          type: string
          title: Alert Explanation System Prompt
      type: object
      required:
        - describe_system_prompt
        - ask_system_prompt
        - alert_explanation_system_prompt
      title: AiPromptDefaultsResponse
      description: >-
        The built-in system prompts, whatever is stored over them.


        A "Restore default" link fills the editor from these; saving ``null``
        for

        the field clears the override and has the same effect server-side.
    AiSettings:
      properties:
        ai_enabled:
          type: boolean
          title: Ai Enabled
        ai_base_url:
          type: string
          title: Ai Base Url
        ai_model:
          type: string
          title: Ai Model
        ai_api_key_configured:
          type: boolean
          title: Ai Api Key Configured
        ai_timeout_seconds:
          type: integer
          title: Ai Timeout Seconds
        ai_max_output_tokens:
          type: integer
          title: Ai Max Output Tokens
        describe_system_prompt:
          type: string
          title: Describe System Prompt
        ask_system_prompt:
          type: string
          title: Ask System Prompt
        alert_explanation_system_prompt:
          type: string
          title: Alert Explanation System Prompt
        search_embeddings_enabled:
          type: boolean
          title: Search Embeddings Enabled
        search_embedding_provider:
          type: string
          title: Search Embedding Provider
        search_embedding_model:
          type: string
          title: Search Embedding Model
        search_embedding_api_key_configured:
          type: boolean
          title: Search Embedding Api Key Configured
        search_embedding_dimensions:
          type: integer
          title: Search Embedding Dimensions
        search_embedding_base_url:
          type: string
          title: Search Embedding Base Url
      type: object
      required:
        - ai_enabled
        - ai_base_url
        - ai_model
        - ai_api_key_configured
        - ai_timeout_seconds
        - ai_max_output_tokens
        - describe_system_prompt
        - ask_system_prompt
        - alert_explanation_system_prompt
        - search_embeddings_enabled
        - search_embedding_provider
        - search_embedding_model
        - search_embedding_api_key_configured
        - search_embedding_dimensions
        - search_embedding_base_url
      title: AiSettings
    AiSettingsResponse:
      properties:
        ai:
          $ref: '#/components/schemas/AiSettings'
        overridden_fields:
          items:
            type: string
          type: array
          title: Overridden Fields
        sources:
          additionalProperties:
            type: string
            enum:
              - env
              - override
              - default
              - org
              - disabled
          type: object
          title: Sources
      type: object
      required:
        - ai
        - overridden_fields
        - sources
      title: AiSettingsResponse
    AiSettingsTestRequest:
      properties:
        prompt:
          type: string
          maxLength: 500
          minLength: 1
          title: Prompt
          default: Reply with the word ok if the LLM connection works.
      type: object
      title: AiSettingsTestRequest
    AiSettingsUpdate:
      properties:
        ai_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Ai Enabled
        ai_base_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Ai Base Url
        ai_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Ai Model
        ai_api_key:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
          title: Ai Api Key
        ai_timeout_seconds:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Ai Timeout Seconds
        ai_max_output_tokens:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Ai Max Output Tokens
        describe_system_prompt:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Describe System Prompt
        ask_system_prompt:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Ask System Prompt
        alert_explanation_system_prompt:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Alert Explanation System Prompt
        search_embeddings_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Search Embeddings Enabled
        search_embedding_provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Search Embedding Provider
        search_embedding_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Search Embedding Model
        search_embedding_api_key:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
          title: Search Embedding Api Key
      type: object
      title: AiSettingsUpdate
    AiStatusResponse:
      properties:
        enabled:
          type: boolean
          title: Enabled
      type: object
      required:
        - enabled
      title: AiStatusResponse
    AlertDeliveryDetailResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        scan_job_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Job Id
        destination_id:
          type: string
          format: uuid
          title: Destination Id
        rule_id:
          type: string
          format: uuid
          title: Rule Id
        destination_name:
          type: string
          title: Destination Name
        rule_name:
          type: string
          title: Rule Name
        scan_name:
          type: string
          title: Scan Name
        status:
          $ref: '#/components/schemas/AlertDeliveryStatus'
        channel:
          $ref: '#/components/schemas/AlertDestinationType'
        matched_count:
          type: integer
          title: Matched Count
        payload_snapshot:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Payload Snapshot
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        is_local:
          type: boolean
          title: Is Local
          default: false
        is_simulated:
          type: boolean
          title: Is Simulated
          default: false
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        sent_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sent At
        items:
          items:
            $ref: '#/components/schemas/AlertDeliveryItemResponse'
          type: array
          title: Items
        owner_notifications:
          items:
            $ref: '#/components/schemas/AlertOwnerNotificationResponse'
          type: array
          title: Owner Notifications
      type: object
      required:
        - id
        - project_id
        - scan_config_id
        - scan_job_id
        - destination_id
        - rule_id
        - destination_name
        - rule_name
        - scan_name
        - status
        - channel
        - matched_count
        - payload_snapshot
        - error_message
        - created_at
        - updated_at
        - sent_at
        - items
      title: AlertDeliveryDetailResponse
    AlertDeliveryItemResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        delivery_id:
          type: string
          format: uuid
          title: Delivery Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        scope_name:
          type: string
          title: Scope Name
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        bucket:
          type: string
          format: date-time
          title: Bucket
        direction:
          $ref: '#/components/schemas/AnomalyDirection'
        actual_count:
          type: number
          title: Actual Count
        expected_count:
          type: number
          title: Expected Count
        absolute_delta:
          type: number
          title: Absolute Delta
        percent_delta:
          anyOf:
            - type: number
            - type: 'null'
          title: Percent Delta
        details_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Details Path
        monitoring_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Monitoring Path
        drift_field:
          anyOf:
            - type: string
            - type: 'null'
          title: Drift Field
        drift_type:
          anyOf:
            - $ref: '#/components/schemas/AlertDriftType'
            - type: 'null'
        sample_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Sample Value
        correlation_group_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Correlation Group Id
      type: object
      required:
        - id
        - delivery_id
        - scope_type
        - scope_ref
        - scope_name
        - event_type_id
        - event_id
        - bucket
        - direction
        - actual_count
        - expected_count
        - absolute_delta
        - percent_delta
        - details_path
        - monitoring_path
        - drift_field
        - drift_type
        - sample_value
      title: AlertDeliveryItemResponse
    AlertDeliveryListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/AlertDeliveryResponse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      type: object
      required:
        - items
        - total
        - next_cursor
      title: AlertDeliveryListResponse
    AlertDeliveryResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        scan_job_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Job Id
        destination_id:
          type: string
          format: uuid
          title: Destination Id
        rule_id:
          type: string
          format: uuid
          title: Rule Id
        destination_name:
          type: string
          title: Destination Name
        rule_name:
          type: string
          title: Rule Name
        scan_name:
          type: string
          title: Scan Name
        status:
          $ref: '#/components/schemas/AlertDeliveryStatus'
        channel:
          $ref: '#/components/schemas/AlertDestinationType'
        matched_count:
          type: integer
          title: Matched Count
        payload_snapshot:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Payload Snapshot
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        is_local:
          type: boolean
          title: Is Local
          default: false
        is_simulated:
          type: boolean
          title: Is Simulated
          default: false
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        sent_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sent At
      type: object
      required:
        - id
        - project_id
        - scan_config_id
        - scan_job_id
        - destination_id
        - rule_id
        - destination_name
        - rule_name
        - scan_name
        - status
        - channel
        - matched_count
        - payload_snapshot
        - error_message
        - created_at
        - updated_at
        - sent_at
      title: AlertDeliveryResponse
    AlertDeliveryStatus:
      type: string
      enum:
        - pending
        - sent
        - failed
      title: AlertDeliveryStatus
    AlertDestinationCreate:
      properties:
        type:
          $ref: '#/components/schemas/AlertDestinationType'
        name:
          type: string
          maxLength: 255
          title: Name
        enabled:
          type: boolean
          title: Enabled
          default: true
        delivery_schedule_cron:
          anyOf:
            - type: string
              maxLength: 120
            - type: 'null'
          title: Delivery Schedule Cron
        webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Url
        bot_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Bot Token
        chat_id:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Chat Id
        target_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Url
        webhook_header_name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Webhook Header Name
        webhook_header_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Header Value
        email_recipients:
          anyOf:
            - type: string
            - type: 'null'
          title: Email Recipients
        email_from_address:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Email From Address
        email_subject_template:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Email Subject Template
        jira_base_url:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Jira Base Url
        jira_auth_email:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Jira Auth Email
        jira_api_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Jira Api Token
        jira_project_key:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Jira Project Key
        jira_issue_type:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Jira Issue Type
        linear_api_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Linear Api Key
        linear_team_id:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Linear Team Id
        linear_state_id:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Linear State Id
        linear_label_ids:
          anyOf:
            - type: string
              maxLength: 1024
            - type: 'null'
          title: Linear Label Ids
        pagerduty_routing_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Pagerduty Routing Key
        pagerduty_severity:
          anyOf:
            - type: string
              maxLength: 16
            - type: 'null'
          title: Pagerduty Severity
        teams_webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Teams Webhook Url
      type: object
      required:
        - type
        - name
      title: AlertDestinationCreate
    AlertDestinationDraftTestRequest:
      properties:
        destination_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Destination Id
        type:
          $ref: '#/components/schemas/AlertDestinationType'
        name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Name
        webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Url
        bot_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Bot Token
        chat_id:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Chat Id
        target_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Url
        webhook_header_name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Webhook Header Name
        webhook_header_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Header Value
        email_recipients:
          anyOf:
            - type: string
            - type: 'null'
          title: Email Recipients
        email_from_address:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Email From Address
        jira_base_url:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Jira Base Url
        jira_auth_email:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Jira Auth Email
        jira_api_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Jira Api Token
        jira_project_key:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Jira Project Key
        jira_issue_type:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Jira Issue Type
        linear_api_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Linear Api Key
        linear_team_id:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Linear Team Id
        linear_state_id:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Linear State Id
        linear_label_ids:
          anyOf:
            - type: string
              maxLength: 1024
            - type: 'null'
          title: Linear Label Ids
        pagerduty_routing_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Pagerduty Routing Key
        pagerduty_severity:
          anyOf:
            - type: string
              maxLength: 16
            - type: 'null'
          title: Pagerduty Severity
        teams_webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Teams Webhook Url
      type: object
      required:
        - type
      title: AlertDestinationDraftTestRequest
      description: >-
        A destination's settings as the dialog holds them, to test before
        saving.


        Setting up Slack used to take Create, close, find the card, then Test —
        and

        a wrong webhook was a stored destination by the time anyone learned it.


        ``destination_id`` names the saved destination an EDIT dialog is open
        on.

        The dialog never holds that row's secrets (they are write-only), so a

        secret left blank here means "the one on file", exactly as the PATCH
        reads

        it; every other field is taken as sent. Without it this is an unsaved

        destination and nothing is borrowed from anywhere.


        Deliberately lenient about what is MISSING: a half-filled form is the

        normal state of a draft, and the answer to testing one is the same

        ``ok: false`` / ``config`` result a stored destination with a bad value
        gets

        — not a 422 the dialog would render as "the request was wrong". What is

        checked here is only what a send must never carry at all: header names
        and

        values that could inject, and ids that could reach another endpoint's
        path.

        Fields the form sends that a test does not use (``enabled``, the
        cadence,

        the subject template) are ignored.
    AlertDestinationResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        type:
          $ref: '#/components/schemas/AlertDestinationType'
        name:
          type: string
          title: Name
        enabled:
          type: boolean
          title: Enabled
        webhook_set:
          type: boolean
          title: Webhook Set
        bot_token_set:
          type: boolean
          title: Bot Token Set
        chat_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Chat Id
        target_url_set:
          type: boolean
          title: Target Url Set
        webhook_header_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Header Name
        email_recipients:
          anyOf:
            - type: string
            - type: 'null'
          title: Email Recipients
        email_from_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Email From Address
        email_subject_template:
          anyOf:
            - type: string
            - type: 'null'
          title: Email Subject Template
        jira_base_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Jira Base Url
        jira_auth_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Jira Auth Email
        jira_api_token_set:
          type: boolean
          title: Jira Api Token Set
        jira_project_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Jira Project Key
        jira_issue_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Jira Issue Type
        linear_api_key_set:
          type: boolean
          title: Linear Api Key Set
        linear_team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Linear Team Id
        linear_state_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Linear State Id
        linear_label_ids:
          anyOf:
            - type: string
            - type: 'null'
          title: Linear Label Ids
        pagerduty_routing_key_set:
          type: boolean
          title: Pagerduty Routing Key Set
        pagerduty_severity:
          anyOf:
            - type: string
            - type: 'null'
          title: Pagerduty Severity
        teams_webhook_set:
          type: boolean
          title: Teams Webhook Set
        delivery_schedule_cron:
          anyOf:
            - type: string
            - type: 'null'
          title: Delivery Schedule Cron
        project_timezone:
          type: string
          title: Project Timezone
          default: UTC
        last_digest_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Digest At
        next_digest_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Next Digest At
        held_count:
          type: integer
          title: Held Count
          default: 0
        is_local:
          type: boolean
          title: Is Local
          default: false
        delivery_count:
          type: integer
          title: Delivery Count
        incident_count:
          type: integer
          title: Incident Count
        rules:
          items:
            $ref: '#/components/schemas/AlertRuleResponse'
          type: array
          title: Rules
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - project_id
        - type
        - name
        - enabled
        - webhook_set
        - bot_token_set
        - chat_id
        - target_url_set
        - webhook_header_name
        - email_recipients
        - email_from_address
        - email_subject_template
        - jira_base_url
        - jira_auth_email
        - jira_api_token_set
        - jira_project_key
        - jira_issue_type
        - linear_api_key_set
        - linear_team_id
        - linear_state_id
        - linear_label_ids
        - pagerduty_routing_key_set
        - pagerduty_severity
        - teams_webhook_set
        - delivery_count
        - incident_count
        - rules
        - created_at
        - updated_at
      title: AlertDestinationResponse
    AlertDestinationTestResponse:
      properties:
        ok:
          type: boolean
          title: Ok
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        sent_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sent At
        error_kind:
          anyOf:
            - type: string
              enum:
                - config
                - policy
                - dns
                - timeout
                - tls
                - network
                - http_status
                - smtp
                - other
            - type: 'null'
          title: Error Kind
        http_status:
          anyOf:
            - type: integer
            - type: 'null'
          title: Http Status
      type: object
      required:
        - ok
        - error
        - sent_at
      title: AlertDestinationTestResponse
      description: >-
        Result of a manual test send — did this destination reach its channel?


        A channel refusal is an ANSWER, not a server fault: a revoked Telegram
        token

        and a healthy one look identical in the destination form, and

        the whole point of the probe is to tell them apart. So the route returns
        200

        with ``ok=False`` and the channel's own message rather than a 5xx the UI
        would

        render as "something went wrong on our side".
    AlertDestinationType:
      type: string
      enum:
        - slack
        - telegram
        - webhook
        - email
        - jira
        - linear
        - pagerduty
        - teams
        - demo_sink
      title: AlertDestinationType
    AlertDestinationUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Name
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
        delivery_schedule_cron:
          anyOf:
            - type: string
            - type: 'null'
          title: Delivery Schedule Cron
        webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Url
        bot_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Bot Token
        chat_id:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Chat Id
        target_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Url
        webhook_header_name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Webhook Header Name
        webhook_header_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Header Value
        email_recipients:
          anyOf:
            - type: string
            - type: 'null'
          title: Email Recipients
        email_from_address:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Email From Address
        email_subject_template:
          anyOf:
            - type: string
            - type: 'null'
          title: Email Subject Template
        jira_base_url:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Jira Base Url
        jira_auth_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Jira Auth Email
        jira_api_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Jira Api Token
        jira_project_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Jira Project Key
        jira_issue_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Jira Issue Type
        linear_api_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Linear Api Key
        linear_team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Linear Team Id
        linear_state_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Linear State Id
        linear_label_ids:
          anyOf:
            - type: string
              maxLength: 1024
            - type: 'null'
          title: Linear Label Ids
        pagerduty_routing_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Pagerduty Routing Key
        pagerduty_severity:
          anyOf:
            - type: string
              maxLength: 16
            - type: 'null'
          title: Pagerduty Severity
        teams_webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Teams Webhook Url
      type: object
      title: AlertDestinationUpdate
    AlertDriftType:
      type: string
      enum:
        - new_field
        - missing_field
        - type_changed
        - enum_violation
        - required_null_violation
        - regex_violation
        - range_violation
        - distribution_shift
        - missing
        - volume_drop
        - value_drift
        - source_late
        - source_overdue
        - sunset_overdue
        - successor_silent
        - new_property
        - missing_required
        - type_change
      title: AlertDriftType
    AlertInboxActionRequest:
      properties:
        action:
          type: string
          enum:
            - acknowledge
            - resolve
            - mute
            - reopen
            - false_positive
            - note
          title: Action
        note:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Note
        muted_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Muted Until
      type: object
      required:
        - action
      title: AlertInboxActionRequest
    AlertInboxActionResponse:
      properties:
        group:
          $ref: '#/components/schemas/AlertInboxGroupResponse'
        overrides_written:
          anyOf:
            - type: integer
            - type: 'null'
          title: Overrides Written
      type: object
      required:
        - group
        - overrides_written
      title: AlertInboxActionResponse
      description: >-
        What the action DID, not only what the group looks like afterwards.


        ``false_positive`` writes no scope override for scope types the ratchet
        does

        not tune — release regressions among them — so the button promised a

        detection change it never made, on 10 of 57 production groups.

        The count is reported so the UI can say "tightened 2 scopes" or "no
        scopes

        tightened"; it must NOT be guessed client-side from ``scope_type``,
        which is

        only the newest item's.
    AlertInboxBulkActionRequest:
      properties:
        correlation_group_ids:
          items:
            type: string
            format: uuid
          type: array
          maxItems: 200
          minItems: 1
          title: Correlation Group Ids
        action:
          type: string
          enum:
            - acknowledge
            - resolve
            - mute
            - reopen
            - false_positive
            - note
          title: Action
        note:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Note
        muted_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Muted Until
      type: object
      required:
        - correlation_group_ids
        - action
      title: AlertInboxBulkActionRequest
      description: >-
        One triage decision applied to several incidents at once.


        A TRIAGE SHORTCUT, not an incident record. There is no group-of-groups

        object, no new table and no migration behind this body: whatever it says
        is

        COPIED into each selected incident's own correlation state, so
        afterwards

        every selected row carries the same note, the same ``acted_at`` and the
        same

        ``acted_by`` and is indistinguishable from N single-incident clicks.


        A persistent supergroup was costed and rejected:

        ``_reopen_closed_incidents`` runs inside the per-rule loop and resets
        member

        incidents individually, so a parent row would either never release —
        because

        no single member's release can speak for it — or leak the moment one
        member

        went quiet. Copying the decision into the members has neither failure.


        ``correlation_group_ids`` comes FIRST to match the
        ``<entity>_ids``-first

        convention every other bulk body in the repo already uses

        (``EventBulkUpdate``, ``EventBulkDelete``, ``VariableBulkUpdate``,

        ``MetricBulkUpdate``, ``DeadEventArchiveRequest``); the action fields
        that

        follow are exactly ``AlertInboxActionRequest``'s, and mean exactly the
        same

        things, so the two bodies stay readable side by side.
    AlertInboxBulkActionResponse:
      properties:
        groups:
          items:
            $ref: '#/components/schemas/AlertInboxGroupResponse'
          type: array
          title: Groups
        batch_id:
          type: string
          format: uuid
          title: Batch Id
        overrides_written:
          anyOf:
            - type: integer
            - type: 'null'
          title: Overrides Written
      type: object
      required:
        - groups
        - batch_id
        - overrides_written
      title: AlertInboxBulkActionResponse
      description: >-
        The rebuilt cards for every incident the batch touched.


        DELIBERATELY NOT the house 204 that ``/bulk-update`` and
        ``/bulk-delete``

        return on events, variables and metrics. Those routes mutate rows the
        caller

        is about to re-fetch anyway; this one replaces cards the operator is
        LOOKING

        AT, and its single-incident sibling ``AlertInboxActionResponse`` already

        answers with the rebuilt group for exactly that reason. A 204 would
        force the

        client to re-list the whole inbox to redraw N rows it had just changed,
        and

        would throw away ``overrides_written``, which that sibling documents as

        nullable and ALWAYS SENT. ``DeadEventArchiveResponse``

        (services/reconciliation_service.py) is the standing precedent in this
        repo

        for a bulk route answering with a body instead of 204.
    AlertInboxGroupResponse:
      properties:
        correlation_group_id:
          type: string
          format: uuid
          title: Correlation Group Id
        status:
          $ref: '#/components/schemas/AlertInboxStatus'
        muted:
          type: boolean
          title: Muted
        muted_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Muted Until
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
        false_positive_count:
          type: integer
          title: False Positive Count
          default: 0
        item_count:
          type: integer
          title: Item Count
        delivery_count:
          type: integer
          title: Delivery Count
        latest_bucket:
          type: string
          format: date-time
          title: Latest Bucket
        latest_delivery_at:
          type: string
          format: date-time
          title: Latest Delivery At
        first_delivery_at:
          type: string
          format: date-time
          title: First Delivery At
        direction:
          $ref: '#/components/schemas/AnomalyDirection'
        actual_count:
          type: number
          title: Actual Count
        expected_count:
          type: number
          title: Expected Count
        percent_delta:
          anyOf:
            - type: number
            - type: 'null'
          title: Percent Delta
        max_abs_percent_delta:
          anyOf:
            - type: number
            - type: 'null'
          title: Max Abs Percent Delta
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        scope_types:
          items:
            $ref: '#/components/schemas/MetricScopeType'
          type: array
          title: Scope Types
        scope_names:
          items:
            type: string
          type: array
          title: Scope Names
        destination_names:
          items:
            type: string
          type: array
          title: Destination Names
        rule_names:
          items:
            type: string
          type: array
          title: Rule Names
        rules:
          items:
            $ref: '#/components/schemas/AlertInboxRuleRef'
          type: array
          title: Rules
        scan_names:
          items:
            type: string
          type: array
          title: Scan Names
        acted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Acted At
        acted_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Acted By
        acted_by_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Acted By Name
        owners:
          items:
            $ref: '#/components/schemas/AlertOwnerRef'
          type: array
          title: Owners
      type: object
      required:
        - correlation_group_id
        - status
        - muted
        - item_count
        - delivery_count
        - latest_bucket
        - latest_delivery_at
        - first_delivery_at
        - direction
        - actual_count
        - expected_count
        - percent_delta
        - max_abs_percent_delta
        - scope_type
        - scope_ref
        - event_id
        - scope_types
        - scope_names
        - destination_names
        - rule_names
        - rules
        - scan_names
        - acted_by_name
      title: AlertInboxGroupResponse
    AlertInboxListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/AlertInboxGroupResponse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        status_counts:
          $ref: '#/components/schemas/AlertInboxStatusCounts'
        window_truncated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Window Truncated At
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      type: object
      required:
        - items
        - total
        - window_truncated_at
        - next_cursor
      title: AlertInboxListResponse
    AlertInboxRuleRef:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - name
      title: AlertInboxRuleRef
      description: >-
        One rule that carried this incident: the id AND the name, together.


        Replaces the parallel ``rule_ids`` / ``rule_names`` arrays, which could
        not

        be zipped: ``rule_ids`` was sorted by UUID and ``rule_names`` by name,
        so

        index *i* of one had nothing to do with index *i* of the other and the
        card

        linked "Volume rule" to whichever monitor happened to sort first. Two
        rules

        of one group can even share a name, so no client-side join could repair
        it

        either.
    AlertInboxStatus:
      type: string
      enum:
        - open
        - acknowledged
        - resolved
        - muted
        - false_positive
      title: AlertInboxStatus
    AlertInboxStatusCounts:
      properties:
        open:
          type: integer
          title: Open
          default: 0
        acknowledged:
          type: integer
          title: Acknowledged
          default: 0
        muted:
          type: integer
          title: Muted
          default: 0
        resolved:
          type: integer
          title: Resolved
          default: 0
        false_positive:
          type: integer
          title: False Positive
          default: 0
      type: object
      title: AlertInboxStatusCounts
      description: >-
        Incidents per effective status over the whole window.


        Counted after the non-status filters and before the status one, so a
        chip

        reads what choosing it would list, without loading every page.
    AlertMessageFormat:
      type: string
      enum:
        - plain
        - slack_mrkdwn
        - telegram_html
        - telegram_markdownv2
      title: AlertMessageFormat
    AlertOwnerNotificationResponse:
      properties:
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        email:
          type: string
          title: Email
        status:
          $ref: '#/components/schemas/AlertOwnerNotificationStatus'
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        sent_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sent At
      type: object
      required:
        - user_id
        - name
        - email
        - status
      title: AlertOwnerNotificationResponse
      description: >-
        One owner email: who, where to, and what became of it.


        ``user_id`` is NULL once the user was deleted; the address stays on
        record.

        ``pending`` is a short-lived claim a worker holds while it sends.
    AlertOwnerNotificationStatus:
      type: string
      enum:
        - pending
        - sent
        - failed
        - skipped
      title: AlertOwnerNotificationStatus
    AlertOwnerRef:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
        name:
          type: string
          title: Name
      type: object
      required:
        - user_id
        - name
      title: AlertOwnerRef
      description: >-
        An owner of the affected event type or catalog metric, for display.


        Only current project members with an email address are listed — exactly
        the

        people "Notify owners" would email. ``name`` falls back to the local
        part of

        the address, never to the whole address.
    AlertRuleCreate:
      properties:
        name:
          type: string
          maxLength: 255
          title: Name
        enabled:
          type: boolean
          title: Enabled
          default: true
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        include_project_total:
          type: boolean
          title: Include Project Total
          default: true
        include_event_types:
          type: boolean
          title: Include Event Types
          default: true
        include_events:
          type: boolean
          title: Include Events
          default: true
        include_schema_drifts:
          type: boolean
          title: Include Schema Drifts
          default: false
        include_distribution_drifts:
          type: boolean
          title: Include Distribution Drifts
          default: false
        include_variable_value_drifts:
          type: boolean
          title: Include Variable Value Drifts
          default: false
        include_release_regressions:
          type: boolean
          title: Include Release Regressions
          default: false
        include_metrics:
          type: boolean
          title: Include Metrics
          default: false
        include_source_freshness:
          type: boolean
          title: Include Source Freshness
          default: false
        include_lifecycle:
          type: boolean
          title: Include Lifecycle
          default: false
        include_property_drifts:
          type: boolean
          title: Include Property Drifts
          default: false
        notify_on_spike:
          type: boolean
          title: Notify On Spike
          default: true
        notify_on_drop:
          type: boolean
          title: Notify On Drop
          default: true
        ai_explanation_enabled:
          type: boolean
          title: Ai Explanation Enabled
          default: false
        notify_owners:
          type: boolean
          title: Notify Owners
          default: false
        min_percent_delta:
          type: number
          minimum: 0
          title: Min Percent Delta
          default: 30
        min_absolute_delta:
          type: number
          minimum: 0
          title: Min Absolute Delta
          default: 0
        min_expected_count:
          type: number
          minimum: 0
          title: Min Expected Count
          default: 0
        cooldown_minutes:
          type: integer
          minimum: 1
          title: Cooldown Minutes
          default: 1440
        message_template:
          anyOf:
            - type: string
            - type: 'null'
          title: Message Template
        items_template:
          anyOf:
            - type: string
            - type: 'null'
          title: Items Template
        message_format:
          $ref: '#/components/schemas/AlertMessageFormat'
          default: plain
        filters:
          items:
            $ref: '#/components/schemas/AlertRuleFilterPayload'
          type: array
          title: Filters
      type: object
      required:
        - name
      title: AlertRuleCreate
    AlertRuleFilterField:
      type: string
      enum:
        - event_type
        - event
        - direction
        - metric
      title: AlertRuleFilterField
    AlertRuleFilterOperator:
      type: string
      enum:
        - eq
        - ne
        - in
        - not_in
      title: AlertRuleFilterOperator
    AlertRuleFilterPayload:
      properties:
        field:
          $ref: '#/components/schemas/AlertRuleFilterField'
        operator:
          $ref: '#/components/schemas/AlertRuleFilterOperator'
        values:
          items:
            type: string
          type: array
          title: Values
      type: object
      required:
        - field
        - operator
      title: AlertRuleFilterPayload
    AlertRuleFilterResponse:
      properties:
        field:
          $ref: '#/components/schemas/AlertRuleFilterField'
        operator:
          $ref: '#/components/schemas/AlertRuleFilterOperator'
        values:
          items:
            type: string
          type: array
          title: Values
        id:
          type: string
          format: uuid
          title: Id
      type: object
      required:
        - field
        - operator
        - id
      title: AlertRuleFilterResponse
    AlertRuleResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        destination_id:
          type: string
          format: uuid
          title: Destination Id
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        name:
          type: string
          title: Name
        enabled:
          type: boolean
          title: Enabled
        include_project_total:
          type: boolean
          title: Include Project Total
        include_event_types:
          type: boolean
          title: Include Event Types
        include_events:
          type: boolean
          title: Include Events
        include_schema_drifts:
          type: boolean
          title: Include Schema Drifts
        include_distribution_drifts:
          type: boolean
          title: Include Distribution Drifts
        include_variable_value_drifts:
          type: boolean
          title: Include Variable Value Drifts
        include_release_regressions:
          type: boolean
          title: Include Release Regressions
        include_metrics:
          type: boolean
          title: Include Metrics
        include_source_freshness:
          type: boolean
          title: Include Source Freshness
        include_lifecycle:
          type: boolean
          title: Include Lifecycle
        include_property_drifts:
          type: boolean
          title: Include Property Drifts
        notify_on_spike:
          type: boolean
          title: Notify On Spike
        notify_on_drop:
          type: boolean
          title: Notify On Drop
        ai_explanation_enabled:
          type: boolean
          title: Ai Explanation Enabled
        notify_owners:
          type: boolean
          title: Notify Owners
          default: false
        min_percent_delta:
          type: number
          title: Min Percent Delta
        min_absolute_delta:
          type: number
          title: Min Absolute Delta
        min_expected_count:
          type: number
          title: Min Expected Count
        cooldown_minutes:
          type: integer
          title: Cooldown Minutes
        message_template:
          anyOf:
            - type: string
            - type: 'null'
          title: Message Template
        items_template:
          anyOf:
            - type: string
            - type: 'null'
          title: Items Template
        message_format:
          $ref: '#/components/schemas/AlertMessageFormat'
        filters:
          items:
            $ref: '#/components/schemas/AlertRuleFilterResponse'
          type: array
          title: Filters
        muted:
          type: boolean
          title: Muted
        muted_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Muted Until
        total_deliveries:
          type: integer
          title: Total Deliveries
        last_delivery_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Delivery At
        last_delivery_status:
          anyOf:
            - $ref: '#/components/schemas/AlertDeliveryStatus'
            - type: 'null'
        incident_count:
          type: integer
          title: Incident Count
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - destination_id
        - scan_config_id
        - name
        - enabled
        - include_project_total
        - include_event_types
        - include_events
        - include_schema_drifts
        - include_distribution_drifts
        - include_variable_value_drifts
        - include_release_regressions
        - include_metrics
        - include_source_freshness
        - include_lifecycle
        - include_property_drifts
        - notify_on_spike
        - notify_on_drop
        - ai_explanation_enabled
        - min_percent_delta
        - min_absolute_delta
        - min_expected_count
        - cooldown_minutes
        - message_template
        - items_template
        - message_format
        - filters
        - muted
        - muted_until
        - total_deliveries
        - last_delivery_at
        - last_delivery_status
        - incident_count
        - created_at
        - updated_at
      title: AlertRuleResponse
    AlertRuleSimulateResponse:
      properties:
        rule_id:
          type: string
          format: uuid
          title: Rule Id
        rule_name:
          type: string
          title: Rule Name
        days:
          type: integer
          title: Days
        window_from:
          type: string
          format: date-time
          title: Window From
        window_to:
          type: string
          format: date-time
          title: Window To
        anomalies_considered:
          type: integer
          title: Anomalies Considered
        matched_before_cooldown:
          type: integer
          title: Matched Before Cooldown
        firings:
          items:
            $ref: '#/components/schemas/SimulatedRuleFiring'
          type: array
          title: Firings
        noisy:
          type: boolean
          title: Noisy
        cooldown_minutes_used:
          type: integer
          title: Cooldown Minutes Used
        cooldown_minutes_saved:
          type: integer
          title: Cooldown Minutes Saved
        min_percent_delta_used:
          type: number
          title: Min Percent Delta Used
        min_percent_delta_saved:
          type: number
          title: Min Percent Delta Saved
        min_expected_count_used:
          type: number
          title: Min Expected Count Used
        min_expected_count_saved:
          type: number
          title: Min Expected Count Saved
        sigma_threshold_used:
          anyOf:
            - type: number
            - type: 'null'
          title: Sigma Threshold Used
        sigma_threshold_saved:
          anyOf:
            - type: number
            - type: 'null'
          title: Sigma Threshold Saved
        rendered_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Rendered Message
      type: object
      required:
        - rule_id
        - rule_name
        - days
        - window_from
        - window_to
        - anomalies_considered
        - matched_before_cooldown
        - firings
        - noisy
        - cooldown_minutes_used
        - cooldown_minutes_saved
        - min_percent_delta_used
        - min_percent_delta_saved
        - min_expected_count_used
        - min_expected_count_saved
        - sigma_threshold_used
        - sigma_threshold_saved
      title: AlertRuleSimulateResponse
    AlertRuleUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Name
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        include_project_total:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Project Total
        include_event_types:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Event Types
        include_events:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Events
        include_schema_drifts:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Schema Drifts
        include_distribution_drifts:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Distribution Drifts
        include_variable_value_drifts:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Variable Value Drifts
        include_release_regressions:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Release Regressions
        include_metrics:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Metrics
        include_source_freshness:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Source Freshness
        include_lifecycle:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Lifecycle
        include_property_drifts:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Include Property Drifts
        notify_on_spike:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Notify On Spike
        notify_on_drop:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Notify On Drop
        ai_explanation_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Ai Explanation Enabled
        notify_owners:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Notify Owners
        min_percent_delta:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Min Percent Delta
        min_absolute_delta:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Min Absolute Delta
        min_expected_count:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Min Expected Count
        cooldown_minutes:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Cooldown Minutes
        message_template:
          anyOf:
            - type: string
            - type: 'null'
          title: Message Template
        items_template:
          anyOf:
            - type: string
            - type: 'null'
          title: Items Template
        message_format:
          anyOf:
            - $ref: '#/components/schemas/AlertMessageFormat'
            - type: 'null'
        filters:
          anyOf:
            - items:
                $ref: '#/components/schemas/AlertRuleFilterPayload'
              type: array
            - type: 'null'
          title: Filters
      type: object
      title: AlertRuleUpdate
    AlertScopeReadiness:
      properties:
        variable_value_drift:
          type: boolean
          title: Variable Value Drift
        distribution_drift:
          type: boolean
          title: Distribution Drift
      type: object
      required:
        - variable_value_drift
        - distribution_drift
      title: AlertScopeReadiness
      description: >-
        Whether each drift-style scope has any source data at all, PROJECT-wide.


        Not a per-rule verdict and not a prediction: it answers "could this
        scope

        ever produce a candidate here", so a client can tell an
        enabled-but-inert

        toggle from a quiet one. Both fields are always sent and

        neither carries a default — see the no-defaults note on

        ``MonitorSummaryItem`` for why a default here would be a lie to the

        generated client rather than a server behaviour.
    AnomalyAttributionResponse:
      properties:
        anomaly_id:
          type: string
          format: uuid
          title: Anomaly Id
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        attribution_status:
          type: string
          enum:
            - ready
            - no_breakdown_columns
            - not_computed
          title: Attribution Status
        attribution:
          anyOf:
            - $ref: '#/components/schemas/SignalAttribution'
            - type: 'null'
      type: object
      required:
        - anomaly_id
        - attribution_status
      title: AnomalyAttributionResponse
      description: '``GET /projects/{slug}/anomalies/{anomaly_id}/attribution``.'
    AnomalyDirection:
      type: string
      enum:
        - spike
        - drop
      title: AnomalyDirection
    AnomalyResetCounts:
      properties:
        metric_anomalies:
          type: integer
          title: Metric Anomalies
        metric_breakdown_anomalies:
          type: integer
          title: Metric Breakdown Anomalies
        metric_baselines:
          type: integer
          title: Metric Baselines
      type: object
      required:
        - metric_anomalies
        - metric_breakdown_anomalies
        - metric_baselines
      title: AnomalyResetCounts
    AnomalyScopeOverrideListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/AnomalyScopeOverrideResponse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
      type: object
      required:
        - items
        - total
      title: AnomalyScopeOverrideListResponse
    AnomalyScopeOverrideResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        scan_config_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Scan Config Name
        scope_type:
          type: string
          title: Scope Type
        scope_ref:
          type: string
          title: Scope Ref
        scope_name:
          type: string
          title: Scope Name
        sigma_threshold:
          type: number
          title: Sigma Threshold
        min_expected_count:
          type: integer
          title: Min Expected Count
        false_positive_count:
          type: integer
          title: False Positive Count
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - scan_config_id
        - scope_type
        - scope_ref
        - scope_name
        - sigma_threshold
        - min_expected_count
        - false_positive_count
        - created_at
        - updated_at
      title: AnomalyScopeOverrideResponse
      description: >-
        One scope the false-positive ratchet has made stricter.


        ``sigma_threshold`` / ``min_expected_count`` are ABSOLUTE and replace
        the

        project settings above for this scope only. Deleting the override is the

        undo — the scope falls straight back to the project values.
    ApiKeyCreate:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
        scope:
          $ref: '#/components/schemas/ApiKeyScope'
          default: read
        expires_in_days:
          anyOf:
            - type: integer
              maximum: 3650
              minimum: 1
            - type: 'null'
          title: Expires In Days
        project_slug:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Project Slug
      type: object
      required:
        - name
      title: ApiKeyCreate
    ApiKeyCreateResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        key_prefix:
          type: string
          title: Key Prefix
        scope:
          $ref: '#/components/schemas/ApiKeyScope'
        project_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Project Id
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
        last_used_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Used At
        created_at:
          type: string
          format: date-time
          title: Created At
        token:
          type: string
          title: Token
      type: object
      required:
        - id
        - name
        - key_prefix
        - scope
        - project_id
        - expires_at
        - revoked_at
        - last_used_at
        - created_at
        - token
      title: ApiKeyCreateResponse
      description: |-
        Returned only once at creation — embeds the raw token operators must
        copy immediately.
    ApiKeyResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        key_prefix:
          type: string
          title: Key Prefix
        scope:
          $ref: '#/components/schemas/ApiKeyScope'
        project_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Project Id
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        revoked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Revoked At
        last_used_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Used At
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - name
        - key_prefix
        - scope
        - project_id
        - expires_at
        - revoked_at
        - last_used_at
        - created_at
      title: ApiKeyResponse
    ApiKeyScope:
      type: string
      enum:
        - read
        - write
      title: ApiKeyScope
    AppVersionAdoptionResponse:
      properties:
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        app_version_column:
          anyOf:
            - type: string
            - type: 'null'
          title: App Version Column
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        latest_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Latest Version
        sigma_threshold:
          type: number
          title: Sigma Threshold
          default: 4
        versions:
          items:
            $ref: '#/components/schemas/AppVersionInfo'
          type: array
          title: Versions
        series:
          items:
            $ref: '#/components/schemas/AppVersionMetricSeries'
          type: array
          title: Series
        totals:
          items:
            $ref: '#/components/schemas/BreakdownTimelinePoint'
          type: array
          title: Totals
      type: object
      required:
        - scan_config_id
        - scope_type
        - scope_ref
        - versions
        - series
        - totals
      title: AppVersionAdoptionResponse
    AppVersionInfo:
      properties:
        version:
          type: string
          title: Version
        is_other:
          type: boolean
          title: Is Other
          default: false
        is_latest:
          type: boolean
          title: Is Latest
          default: false
        is_active:
          type: boolean
          title: Is Active
          default: false
      type: object
      required:
        - version
      title: AppVersionInfo
    AppVersionMetricSeries:
      properties:
        version:
          type: string
          title: Version
        is_other:
          type: boolean
          title: Is Other
          default: false
        is_latest:
          type: boolean
          title: Is Latest
          default: false
        is_active:
          type: boolean
          title: Is Active
          default: false
        total_count:
          type: integer
          title: Total Count
        data:
          items:
            $ref: '#/components/schemas/EventMetricPoint'
          type: array
          title: Data
      type: object
      required:
        - version
        - total_count
        - data
      title: AppVersionMetricSeries
    AppVersionSeriesResponse:
      properties:
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        app_version_column:
          anyOf:
            - type: string
            - type: 'null'
          title: App Version Column
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        latest_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Latest Version
        sigma_threshold:
          type: number
          title: Sigma Threshold
          default: 4
        versions:
          items:
            $ref: '#/components/schemas/AppVersionInfo'
          type: array
          title: Versions
        series:
          items:
            $ref: '#/components/schemas/AppVersionMetricSeries'
          type: array
          title: Series
      type: object
      required:
        - scan_config_id
        - scope_type
        - scope_ref
        - versions
        - series
      title: AppVersionSeriesResponse
    AttributionColumn:
      properties:
        column:
          type: string
          title: Column
        explained_share:
          type: number
          title: Explained Share
        values:
          items:
            $ref: '#/components/schemas/AttributionValue'
          type: array
          title: Values
      type: object
      required:
        - column
        - explained_share
      title: AttributionColumn
      description: |-
        One breakdown column's split: its top values and the part of the change
        they explain (0..1).
    AttributionRelease:
      properties:
        version:
          type: string
          title: Version
        previous_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Version
        share:
          type: number
          title: Share
        reached_at:
          type: string
          format: date-time
          title: Reached At
      type: object
      required:
        - version
        - share
        - reached_at
      title: AttributionRelease
      description: A release that crossed the activation gate shortly before the signal.
    AttributionValue:
      properties:
        value:
          type: string
          title: Value
        delta:
          type: number
          title: Delta
        expected:
          type: number
          title: Expected
        actual:
          type: number
          title: Actual
        share:
          type: number
          title: Share
      type: object
      required:
        - value
        - delta
        - expected
        - actual
        - share
      title: AttributionValue
      description: >-
        One breakdown value's part of a signal's delta (F02, #255).


        ``delta`` is ``actual - expected`` for the value, where ``expected`` is
        the

        scope's expected total times the value's baseline share; ``share`` is

        ``delta`` over the signal's delta (signed: a value moving against the

        change is negative).
    AuditActionCatalog:
      properties:
        project:
          items:
            $ref: '#/components/schemas/AuditActionGroup'
          type: array
          title: Project
        workspace:
          items:
            $ref: '#/components/schemas/AuditActionGroup'
          type: array
          title: Workspace
      type: object
      required:
        - project
        - workspace
      title: AuditActionCatalog
      description: >-
        Every action the audit log records, grouped for the filter.


        ``project`` holds the actions recorded WITH a project — the only ones a

        project-scoped query can match. ``workspace`` holds those recorded with
        no

        project (data sources, users, instance settings, a deleted project),
        which

        only the organization-wide feed (Enterprise) can match. An action is in
        exactly one.
    AuditActionGroup:
      properties:
        label:
          type: string
          title: Label
        actions:
          items:
            type: string
          type: array
          title: Actions
      type: object
      required:
        - label
        - actions
      title: AuditActionGroup
      description: One labelled group of the audit action filter.
    AuditEntryDetailResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
        user_email:
          type: string
          title: User Email
        project_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Project Id
        project_slug:
          type: string
          title: Project Slug
        branch_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Branch Id
        branch_name:
          type: string
          title: Branch Name
        action:
          type: string
          title: Action
        target_type:
          type: string
          title: Target Type
        target_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Target Id
        target_name:
          type: string
          title: Target Name
        payload:
          additionalProperties: true
          type: object
          title: Payload
      type: object
      required:
        - id
        - created_at
        - user_id
        - user_email
        - project_id
        - project_slug
        - branch_id
        - branch_name
        - action
        - target_type
        - target_id
        - target_name
        - payload
      title: AuditEntryDetailResponse
      description: >-
        One entry WITH the request payload that produced it.


        ``payload`` is the half of an audit entry that carries warehouse hosts
        and

        ``base_query`` SQL, which is why the whole router is owner-only — see
        the

        gate write-up in api/v1/project_audit.py. Secrets are already masked at
        write time

        by ``audit_service._redact``.
    AuditEntryResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
        user_email:
          type: string
          title: User Email
        project_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Project Id
        project_slug:
          type: string
          title: Project Slug
        branch_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Branch Id
        branch_name:
          type: string
          title: Branch Name
        action:
          type: string
          title: Action
        target_type:
          type: string
          title: Target Type
        target_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Target Id
        target_name:
          type: string
          title: Target Name
      type: object
      required:
        - id
        - created_at
        - user_id
        - user_email
        - project_id
        - project_slug
        - branch_id
        - branch_name
        - action
        - target_type
        - target_id
        - target_name
      title: AuditEntryResponse
      description: >-
        One row of the audit list — everything the row itself renders.


        Deliberately WITHOUT ``payload``. The tab renders a payload only for the

        rows the reader expanded (AuditTab.tsx), so shipping one per row sent a
        page

        of JSON blobs across the wire to be displayed nowhere: on the only
        project

        with real audit history, ``/p/*/audit`` had the slowest first

        content of the 75 routes in the 2026-08-17 walk. The payload now travels
        one

        row at a time, as ``AuditEntryDetailResponse``.


        ``branch_id`` / ``branch_name`` are the plan branch the write was scoped
        to.

        Null and empty mean the write was not made through a branch-scoped
        request —

        main, or an action with no plan-branch dimension (alerting, scans,
        users) —

        so a reader must not render them as "main".
    AuditListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/AuditEntryResponse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
      type: object
      required:
        - items
        - total
      title: AuditListResponse
    AuthStatusResponse:
      properties:
        has_users:
          type: boolean
          title: Has Users
        registration_enabled:
          type: boolean
          title: Registration Enabled
          default: true
        email_configured:
          type: boolean
          title: Email Configured
          default: false
        deployment_mode:
          type: string
          enum:
            - self_hosted
            - hosted
          title: Deployment Mode
          default: self_hosted
        email_verification_required:
          type: boolean
          title: Email Verification Required
          default: false
        google_sign_in:
          type: boolean
          title: Google Sign In
          default: false
        oidc_sign_in:
          type: boolean
          title: Oidc Sign In
          default: false
        oidc_button_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Oidc Button Label
        public_demo:
          type: boolean
          title: Public Demo
          default: false
        multi_org:
          type: boolean
          title: Multi Org
          default: false
      type: object
      required:
        - has_users
      title: AuthStatusResponse
    AuthUserResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        email:
          type: string
          title: Email
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        role:
          anyOf:
            - $ref: '#/components/schemas/OrganizationRole'
            - type: 'null'
        is_platform_admin:
          type: boolean
          title: Is Platform Admin
          default: false
        email_verified:
          type: boolean
          title: Email Verified
          default: false
        orgs:
          items:
            $ref: '#/components/schemas/OrgMembershipOut'
          type: array
          title: Orgs
        org:
          anyOf:
            - type: string
            - type: 'null'
          title: Org
        api_key_scope:
          anyOf:
            - $ref: '#/components/schemas/ApiKeyScope'
            - type: 'null'
        active_step_ins:
          items:
            $ref: '#/components/schemas/ActiveStepInOut'
          type: array
          title: Active Step Ins
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - email
        - name
        - role
        - created_at
        - updated_at
      title: AuthUserResponse
      description: >-
        The signed-in account. Built by
        ``auth_service.build_auth_user_response``.


        ``role`` is the organization role in the organization the request acts
        in

        (``None`` when the user belongs to none that applies); ``orgs`` lists
        every

        membership. ``is_platform_admin`` is the operator flag, which grants the

        operator settings and nothing inside any organization.
    BigQuerySettings:
      properties:
        location:
          anyOf:
            - type: string
              maxLength: 40
            - type: 'null'
          title: Location
        maximum_bytes_billed:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Maximum Bytes Billed
        dataset_allowlist:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Dataset Allowlist
      additionalProperties: false
      type: object
      title: BigQuerySettings
      description: Typed BigQuery execution controls (location, cost guard, dataset scope).
    Body_import_docs_zip_api_v1_projects__slug__docs_import_zip_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
          description: A zip of .md files.
      type: object
      required:
        - file
      title: Body_import_docs_zip_api_v1_projects__slug__docs_import_zip_post
    Body_upload_event_photo_api_v1_projects__slug__events__event_id__photos_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
      type: object
      required:
        - file
      title: >-
        Body_upload_event_photo_api_v1_projects__slug__events__event_id__photos_post
    BranchApprovalResponse:
      properties:
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
        approved_at:
          type: string
          format: date-time
          title: Approved At
        stale:
          type: boolean
          title: Stale
      type: object
      required:
        - user_id
        - approved_at
        - stale
      title: BranchApprovalResponse
    BranchCommentCreate:
      properties:
        body:
          type: string
          title: Body
        parent_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Parent Id
      type: object
      required:
        - body
      title: BranchCommentCreate
    BranchCommentResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        branch_id:
          type: string
          format: uuid
          title: Branch Id
        parent_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Parent Id
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
        body:
          type: string
          title: Body
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - branch_id
        - parent_id
        - user_id
        - body
        - created_at
        - updated_at
      title: BranchCommentResponse
    BranchConflictsResponse:
      properties:
        entities:
          items:
            $ref: '#/components/schemas/ConflictEntity'
          type: array
          title: Entities
        unresolved_count:
          type: integer
          title: Unresolved Count
        behind:
          type: boolean
          title: Behind
          default: false
        overlap_count:
          type: integer
          title: Overlap Count
          default: 0
        merge_blocked:
          type: boolean
          title: Merge Blocked
          default: false
        updatable:
          type: boolean
          title: Updatable
          default: true
      type: object
      required:
        - entities
        - unresolved_count
      title: BranchConflictsResponse
    BranchKind:
      type: string
      enum:
        - main
        - working
      title: BranchKind
    BranchRevertRequest:
      properties:
        entity_type:
          type: string
          enum:
            - event_type
            - field_definition
            - event
            - variable
            - meta_field
            - relation
          title: Entity Type
        name:
          type: string
          title: Name
        parent:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
        entity_id:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Entity Id
      type: object
      required:
        - entity_type
        - name
      title: BranchRevertRequest
      description: >-
        Undo one entry of the branch's diff.


        The entry is addressed the way the diff names it — entity type, natural
        name

        and parent — so the request describes a *change* rather than a row, plus

        the entry's own ``entity_id`` where a name may be shared (events and

        relations). ``field`` narrows the revert to one changed field; omitted,
        the

        whole entity goes back to its base state.
    BranchReviewerCreate:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
      type: object
      required:
        - user_id
      title: BranchReviewerCreate
    BranchReviewerResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        user_id:
          type: string
          format: uuid
          title: User Id
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - user_id
        - created_at
      title: BranchReviewerResponse
    BranchStatus:
      type: string
      enum:
        - draft
        - ready_for_review
        - changes_requested
        - approved
        - merged
        - closed
      title: BranchStatus
      description: >-
        Review workflow states for a working branch.


        The ``main`` branch is stored with ``merged`` here: the migration that
        added

        branches, ``default_branch_id`` and

        ``plan_branch_service.ensure_main_branch_id`` all write it so. That
        status

        says nothing about main, so code must decide main-ness by ``kind ==
        main``

        BEFORE it reads the status. The read-only refusal of writes to a merged
        or

        closed branch (``api.deps.get_branch_id_override``,

        ``event_photo_service._get_plan_writable_event``) splits main off first
        for

        exactly this reason: a write naming main by its id lands on main, and a

        photo write on a main event is accepted, because both split main off
        before

        they look at the status. Were the status read first, main's stored

        ``merged`` would refuse them both with a 409 — which is what this field

        means for a WORKING branch and what it must never be allowed to mean
        here.
    BranchTransitionRequest:
      properties:
        action:
          type: string
          enum:
            - submit
            - request_changes
            - approve
            - reopen
            - close
          title: Action
      type: object
      required:
        - action
      title: BranchTransitionRequest
    BreakdownTimelinePoint:
      properties:
        bucket:
          type: string
          format: date-time
          title: Bucket
        count:
          type: integer
          title: Count
      type: object
      required:
        - bucket
        - count
      title: BreakdownTimelinePoint
    BreakdownTimelineResponse:
      properties:
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        breakdown_column:
          type: string
          title: Breakdown Column
        breakdown_value:
          type: string
          title: Breakdown Value
        is_other:
          type: boolean
          title: Is Other
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        data:
          items:
            $ref: '#/components/schemas/BreakdownTimelinePoint'
          type: array
          title: Data
      type: object
      required:
        - scan_config_id
        - scope_type
        - scope_ref
        - breakdown_column
        - breakdown_value
        - is_other
        - interval
        - data
      title: BreakdownTimelineResponse
    ChartAnnotationCreate:
      properties:
        bucket:
          type: string
          format: date-time
          title: Bucket
        label:
          type: string
          maxLength: 200
          minLength: 1
          title: Label
        description:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Description
        color:
          type: string
          maxLength: 20
          title: Color
          default: '#ef4444'
        scope_type:
          anyOf:
            - $ref: '#/components/schemas/ChartAnnotationScopeType'
            - type: 'null'
        scope_ref:
          anyOf:
            - type: string
              maxLength: 120
            - type: 'null'
          title: Scope Ref
        source:
          $ref: '#/components/schemas/ChartAnnotationSource'
          default: manual
        url:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Url
      type: object
      required:
        - bucket
        - label
      title: ChartAnnotationCreate
    ChartAnnotationResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        scope_type:
          anyOf:
            - $ref: '#/components/schemas/ChartAnnotationScopeType'
            - type: 'null'
        scope_ref:
          anyOf:
            - type: string
            - type: 'null'
          title: Scope Ref
        bucket:
          type: string
          format: date-time
          title: Bucket
        label:
          type: string
          title: Label
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        color:
          type: string
          title: Color
        source:
          $ref: '#/components/schemas/ChartAnnotationSource'
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        created_by_user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Created By User Id
        created_at:
          type: string
          format: date-time
          title: Created At
        scope_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Scope Name
      type: object
      required:
        - id
        - project_id
        - scope_type
        - scope_ref
        - bucket
        - label
        - description
        - color
        - source
        - url
        - created_by_user_id
        - created_at
      title: ChartAnnotationResponse
    ChartAnnotationScopeType:
      type: string
      enum:
        - project_total
        - event_type
        - event
        - metric
      title: ChartAnnotationScopeType
    ChartAnnotationSource:
      type: string
      enum:
        - manual
        - release
        - api
      title: ChartAnnotationSource
      description: >-
        Who put a chart annotation there.


        ``manual`` is a person in the UI, ``api`` is a CI/CLI client posting a

        deploy marker, and ``release`` is the metrics worker marking the bucket
        an

        app version activated in. ``release`` is reserved to the worker: the
        create

        API refuses it, so every release marker is one the activation gate drew.
    ClickHouseSettings:
      properties: {}
      additionalProperties: false
      type: object
      title: ClickHouseSettings
      description: |-
        ClickHouse has no extra connection settings.

        Its two knobs — ``timeout_seconds`` and ``json_path_discovery`` — are
        first-class columns on the data source, not connection settings.
    CodegenEvent:
      properties:
        identity:
          type: string
          title: Identity
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
          default: ''
        status:
          type: string
          title: Status
        field_values:
          additionalProperties:
            type: string
          type: object
          title: Field Values
        overrides:
          additionalProperties:
            items:
              type: string
            type: array
          type: object
          title: Overrides
        deprecated:
          type: boolean
          title: Deprecated
          default: false
        properties:
          items:
            $ref: '#/components/schemas/CodegenProperty'
          type: array
          title: Properties
      type: object
      required:
        - identity
        - name
        - status
      title: CodegenEvent
    CodegenEventType:
      properties:
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
          default: ''
        description:
          type: string
          title: Description
          default: ''
        name_rule:
          anyOf:
            - type: string
            - type: 'null'
          title: Name Rule
        fields:
          items:
            $ref: '#/components/schemas/CodegenField'
          type: array
          title: Fields
        events:
          items:
            $ref: '#/components/schemas/CodegenEvent'
          type: array
          title: Events
      type: object
      required:
        - name
      title: CodegenEventType
    CodegenField:
      properties:
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
          default: ''
        description:
          type: string
          title: Description
          default: ''
        required:
          type: boolean
          title: Required
          default: false
        type:
          type: string
          title: Type
        values:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Values
        variable:
          anyOf:
            - type: string
            - type: 'null'
          title: Variable
      type: object
      required:
        - name
        - type
      title: CodegenField
    CodegenProperty:
      properties:
        field:
          type: string
          title: Field
        path:
          type: string
          title: Path
        variable:
          anyOf:
            - type: string
            - type: 'null'
          title: Variable
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
        json_schema:
          additionalProperties: true
          type: object
          title: Json Schema
        required:
          type: boolean
          title: Required
          default: false
        values:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Values
        literal:
          title: Literal
      type: object
      required:
        - field
        - path
      title: CodegenProperty
      description: 'One typed property of an event: a leaf of one of its JSON fields (F23).'
    CodegenVariable:
      properties:
        name:
          type: string
          title: Name
        allowed_values:
          items:
            type: string
          type: array
          title: Allowed Values
        tokens:
          items:
            type: string
          type: array
          title: Tokens
        variable_type:
          type: string
          title: Variable Type
          default: string
        json_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Json Schema
      type: object
      required:
        - name
      title: CodegenVariable
    ColumnSchema:
      properties:
        name:
          type: string
          title: Name
        data_type:
          type: string
          title: Data Type
      type: object
      required:
        - name
        - data_type
      title: ColumnSchema
    CombinedSettingsResponse:
      properties:
        runtime:
          $ref: '#/components/schemas/RuntimeSettings'
        security:
          anyOf:
            - $ref: '#/components/schemas/SecuritySettings'
            - type: 'null'
        storage:
          anyOf:
            - $ref: '#/components/schemas/StorageSettings'
            - type: 'null'
        observability:
          anyOf:
            - $ref: '#/components/schemas/ObservabilitySettings'
            - type: 'null'
        email:
          $ref: '#/components/schemas/EmailSettings'
        ai:
          $ref: '#/components/schemas/AiSettings'
        system:
          anyOf:
            - $ref: '#/components/schemas/SystemSettings'
            - type: 'null'
        overridden_fields:
          items:
            type: string
          type: array
          title: Overridden Fields
        sources:
          additionalProperties:
            type: string
            enum:
              - env
              - override
              - default
              - org
              - disabled
          type: object
          title: Sources
      type: object
      required:
        - runtime
        - security
        - storage
        - observability
        - email
        - ai
        - system
        - overridden_fields
        - sources
      title: CombinedSettingsResponse
      description: |-
        The legacy ``/settings`` view (F20 PR9).

        The operator's infrastructure sections are ``None`` for everyone but a
        platform admin: an organization admin reading its own organization's
        values has no business with the operator's server paths, buckets,
        telemetry endpoint or security policy. ``/platform/settings`` answers
        :class:`ServiceSettingsResponse` with every section filled in.
    ComponentAverage:
      properties:
        key:
          type: string
          enum:
            - implemented_seen
            - contract
            - drifts
            - signals
            - freshness
            - documentation
          title: Key
        value:
          anyOf:
            - type: number
            - type: 'null'
          title: Value
        applies_count:
          type: integer
          title: Applies Count
      type: object
      required:
        - key
        - applies_count
      title: ComponentAverage
      description: Mean component value over the events it applies to (null when none).
    ConflictEntity:
      properties:
        entity_type:
          type: string
          enum:
            - event_type
            - field_definition
            - event
            - variable
            - meta_field
            - relation
          title: Entity Type
        name:
          type: string
          title: Name
        parent:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent
        label:
          type: string
          title: Label
          default: ''
        fields:
          items:
            $ref: '#/components/schemas/ConflictField'
          type: array
          title: Fields
      type: object
      required:
        - entity_type
        - name
        - fields
      title: ConflictEntity
    ConflictField:
      properties:
        field:
          type: string
          title: Field
        base:
          anyOf:
            - {}
            - type: 'null'
          title: Base
        ours:
          anyOf:
            - {}
            - type: 'null'
          title: Ours
        theirs:
          anyOf:
            - {}
            - type: 'null'
          title: Theirs
        choice:
          anyOf:
            - $ref: '#/components/schemas/MergeResolutionChoice'
            - type: 'null'
        dependents:
          type: integer
          title: Dependents
          default: 0
      type: object
      required:
        - field
        - base
        - ours
        - theirs
      title: ConflictField
      description: >-
        A single field that diverged on both sides.


        ``base`` is the value when the branch was created (or last updated from

        main); ``ours`` is main's current value; ``theirs`` is the branch's
        current

        value. ``choice`` names the value to END with — ``ours`` takes main's,

        ``theirs`` keeps the branch's — for the merge and for "Update from main"

        alike; ``None`` means unresolved.


        ``field`` is ``@presence`` when one side deleted the entity and the
        other

        changed it: ``base``/``ours``/``theirs`` are then ``"present"`` or

        ``"absent"``. ``dependents`` counts, for an event type main deleted, the

        fields, events and relations this branch added or edited under it — what

        taking main's side removes with it.
    ConnectionSettingsResponse:
      properties:
        location:
          anyOf:
            - type: string
            - type: 'null'
          title: Location
        maximum_bytes_billed:
          anyOf:
            - type: integer
            - type: 'null'
          title: Maximum Bytes Billed
        dataset_allowlist:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Dataset Allowlist
        sslmode:
          anyOf:
            - type: string
              enum:
                - disable
                - allow
                - prefer
                - require
                - verify-ca
                - verify-full
            - type: 'null'
          title: Sslmode
        sslrootcert:
          anyOf:
            - type: string
            - type: 'null'
          title: Sslrootcert
        sslcert:
          anyOf:
            - type: string
            - type: 'null'
          title: Sslcert
        search_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Search Path
        sslkey_set:
          type: boolean
          title: Sslkey Set
          default: false
      type: object
      title: ConnectionSettingsResponse
      description: >-
        Read side of the connection settings: the union, flattened, secrets
        removed.


        Applicability is enforced on write, so the response can be one flat
        object;

        only the fields that apply to the source's ``db_type`` are ever
        populated.
    CoverageBucket:
      properties:
        bucket:
          type: string
          format: date-time
          title: Bucket
        total_count:
          type: integer
          title: Total Count
        matched_count:
          type: integer
          title: Matched Count
      type: object
      required:
        - bucket
        - total_count
        - matched_count
      title: CoverageBucket
    CoverageResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/CoverageBucket'
          type: array
          title: Items
        summary:
          $ref: '#/components/schemas/CoverageSummary'
        days:
          type: integer
          title: Days
      type: object
      required:
        - items
        - summary
        - days
      title: CoverageResponse
    CoverageSummary:
      properties:
        total_count:
          type: integer
          title: Total Count
        matched_count:
          type: integer
          title: Matched Count
        coverage_pct:
          type: number
          title: Coverage Pct
      type: object
      required:
        - total_count
        - matched_count
        - coverage_pct
      title: CoverageSummary
    DBType:
      type: string
      enum:
        - clickhouse
        - postgres
        - bigquery
        - synthetic
      title: DBType
    DataSourceConnectionTest:
      properties:
        name:
          type: string
          maxLength: 255
          title: Name
          default: ''
        db_type:
          $ref: '#/components/schemas/DBType'
        host:
          type: string
          maxLength: 500
          minLength: 1
          title: Host
        port:
          type: integer
          maximum: 65535
          minimum: 1
          title: Port
          default: 8123
        database_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Database Name
        username:
          type: string
          maxLength: 255
          title: Username
          default: ''
        password:
          type: string
          title: Password
          default: ''
        timeout_seconds:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Timeout Seconds
        json_path_discovery:
          anyOf:
            - type: string
              enum:
                - all
                - dynamic
            - type: 'null'
          title: Json Path Discovery
        connection_settings:
          anyOf:
            - $ref: '#/components/schemas/ClickHouseSettings'
            - $ref: '#/components/schemas/PostgresSettings'
            - $ref: '#/components/schemas/BigQuerySettings'
            - $ref: '#/components/schemas/SyntheticSettings'
            - type: 'null'
          title: Connection Settings
      type: object
      required:
        - db_type
        - host
        - database_name
      title: DataSourceConnectionTest
      description: >-
        An unsaved data-source config to test a connection with.


        The create body, validated the same way (host format included), so a
        form

        can test exactly what Create would store. ``name`` is optional because
        the

        test does not store anything. Every secret the probe needs travels in
        this

        request; nothing is read from or written to a stored source.
    DataSourceConnectionTestResponse:
      properties:
        success:
          type: boolean
          title: Success
        message:
          type: string
          title: Message
        tested_at:
          type: string
          format: date-time
          title: Tested At
      type: object
      required:
        - success
        - message
        - tested_at
      title: DataSourceConnectionTestResponse
    DataSourceCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        db_type:
          $ref: '#/components/schemas/DBType'
        host:
          type: string
          maxLength: 500
          minLength: 1
          title: Host
        port:
          type: integer
          maximum: 65535
          minimum: 1
          title: Port
          default: 8123
        database_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Database Name
        username:
          type: string
          maxLength: 255
          title: Username
          default: ''
        password:
          type: string
          title: Password
          default: ''
        timeout_seconds:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Timeout Seconds
        json_path_discovery:
          anyOf:
            - type: string
              enum:
                - all
                - dynamic
            - type: 'null'
          title: Json Path Discovery
        connection_settings:
          anyOf:
            - $ref: '#/components/schemas/ClickHouseSettings'
            - $ref: '#/components/schemas/PostgresSettings'
            - $ref: '#/components/schemas/BigQuerySettings'
            - $ref: '#/components/schemas/SyntheticSettings'
            - type: 'null'
          title: Connection Settings
      type: object
      required:
        - name
        - db_type
        - host
        - database_name
      title: DataSourceCreate
    DataSourceResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Project Id
        name:
          type: string
          title: Name
        db_type:
          $ref: '#/components/schemas/DBType'
        is_synthetic:
          type: boolean
          title: Is Synthetic
        host:
          type: string
          title: Host
        port:
          type: integer
          title: Port
        database_name:
          type: string
          title: Database Name
        username:
          type: string
          title: Username
        password_set:
          type: boolean
          title: Password Set
        timeout_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timeout Seconds
        json_path_discovery:
          anyOf:
            - type: string
              enum:
                - all
                - dynamic
            - type: 'null'
          title: Json Path Discovery
        connection_settings:
          $ref: '#/components/schemas/ConnectionSettingsResponse'
        last_test_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Test At
        last_test_status:
          anyOf:
            - $ref: '#/components/schemas/TestStatus'
            - type: 'null'
        last_test_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Test Message
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        scan_count:
          type: integer
          title: Scan Count
          default: 0
        scan_run_count:
          type: integer
          title: Scan Run Count
          default: 0
        scans:
          items:
            $ref: '#/components/schemas/DataSourceScanRef'
          type: array
          title: Scans
      type: object
      required:
        - id
        - name
        - db_type
        - is_synthetic
        - host
        - port
        - database_name
        - username
        - password_set
        - connection_settings
        - last_test_at
        - last_test_status
        - last_test_message
        - created_at
        - updated_at
      title: DataSourceResponse
    DataSourceScanRef:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        project_slug:
          type: string
          title: Project Slug
        project_name:
          type: string
          title: Project Name
      type: object
      required:
        - id
        - name
        - project_slug
        - project_name
      title: DataSourceScanRef
      description: One scan reading a data source, enough to link to it.
    DataSourceSchemaResponse:
      properties:
        tables:
          items:
            $ref: '#/components/schemas/TableSchema'
          type: array
          title: Tables
      type: object
      required:
        - tables
      title: DataSourceSchemaResponse
    DataSourceStatsResponse:
      properties:
        events_tracked:
          type: integer
          title: Events Tracked
        volume_window:
          type: integer
          title: Volume Window
        window_hours:
          type: integer
          title: Window Hours
        throughput:
          items:
            $ref: '#/components/schemas/DataSourceThroughputPoint'
          type: array
          title: Throughput
      type: object
      required:
        - events_tracked
        - volume_window
        - window_hours
        - throughput
      title: DataSourceStatsResponse
      description: Runtime activity for a data source, aggregated from EventMetric rollups.
    DataSourceTestResponse:
      properties:
        success:
          type: boolean
          title: Success
        message:
          type: string
          title: Message
        tested_at:
          type: string
          format: date-time
          title: Tested At
        data_source:
          $ref: '#/components/schemas/DataSourceResponse'
      type: object
      required:
        - success
        - message
        - tested_at
        - data_source
      title: DataSourceTestResponse
    DataSourceThroughputPoint:
      properties:
        bucket:
          type: string
          format: date-time
          title: Bucket
        count:
          type: integer
          title: Count
      type: object
      required:
        - bucket
        - count
      title: DataSourceThroughputPoint
    DataSourceUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
        db_type:
          anyOf:
            - $ref: '#/components/schemas/DBType'
            - type: 'null'
        host:
          anyOf:
            - type: string
              maxLength: 500
              minLength: 1
            - type: 'null'
          title: Host
        port:
          anyOf:
            - type: integer
              maximum: 65535
              minimum: 1
            - type: 'null'
          title: Port
        database_name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Database Name
        username:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Username
        password:
          anyOf:
            - type: string
            - type: 'null'
          title: Password
        timeout_seconds:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Timeout Seconds
        json_path_discovery:
          anyOf:
            - type: string
              enum:
                - all
                - dynamic
            - type: 'null'
          title: Json Path Discovery
        connection_settings:
          anyOf:
            - $ref: '#/components/schemas/ClickHouseSettings'
            - $ref: '#/components/schemas/PostgresSettings'
            - $ref: '#/components/schemas/BigQuerySettings'
            - $ref: '#/components/schemas/SyntheticSettings'
            - type: 'null'
          title: Connection Settings
      type: object
      title: DataSourceUpdate
    DeadEventArchiveRequest:
      properties:
        event_ids:
          items:
            type: string
            format: uuid
          type: array
          minItems: 1
          title: Event Ids
        status:
          $ref: '#/components/schemas/EventStatus'
          default: archived
      type: object
      required:
        - event_ids
      title: DeadEventArchiveRequest
      description: |-
        Bulk-retire request for dead events.

        ``status`` is constrained to the two terminal lifecycle states so the
        action can only deprecate or archive — never resurrect — an event.
    DeadEventArchiveResponse:
      properties:
        event_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Event Ids
        status:
          $ref: '#/components/schemas/EventStatus'
        archived_count:
          type: integer
          title: Archived Count
      type: object
      required:
        - event_ids
        - status
        - archived_count
      title: DeadEventArchiveResponse
    DeadEventItem:
      properties:
        event_id:
          type: string
          format: uuid
          title: Event Id
        name:
          type: string
          title: Name
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        event_type_name:
          type: string
          title: Event Type Name
        last_seen_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Seen At
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - event_id
        - name
        - event_type_id
        - event_type_name
        - last_seen_at
        - created_at
      title: DeadEventItem
    DeadEventListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/DeadEventItem'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        days:
          type: integer
          title: Days
      type: object
      required:
        - items
        - total
        - days
      title: DeadEventListResponse
    DemoCancelResponse:
      properties:
        cancelled:
          type: boolean
          title: Cancelled
        slug:
          anyOf:
            - type: string
            - type: 'null'
          title: Slug
        state:
          type: string
          enum:
            - stopped
            - finished
            - none
          title: State
      type: object
      required:
        - cancelled
        - state
      title: DemoCancelResponse
      description: >-
        Outcome of asking an in-flight demo provision to abandon itself.


        ``cancelled`` is only true when a still-seeding shell was found and
        flagged;

        the provision then deletes itself instead of promoting.


        When it is false there was nothing to stop, and ``state`` says which of
        two

        very different things that means: ``finished`` — a demo of this

        user's became ready moments ago, so it WILL be in their projects list
        and

        the caller should say so — or ``none`` — no recent demo exists, the
        create

        never got far enough (or failed on its own), and the caller must not
        promise

        anything will appear. ``stopped`` always pairs with ``cancelled=true``.
    DependenciesResponse:
      properties:
        entity:
          $ref: '#/components/schemas/DependencyEntity'
        upstream:
          items:
            $ref: '#/components/schemas/DependencyEdge'
          type: array
          title: Upstream
        downstream:
          items:
            $ref: '#/components/schemas/DependencyEdge'
          type: array
          title: Downstream
        counts_by_kind:
          additionalProperties:
            type: integer
          type: object
          title: Counts By Kind
        possible_counts_by_kind:
          additionalProperties:
            type: integer
          type: object
          title: Possible Counts By Kind
      type: object
      required:
        - entity
        - upstream
        - downstream
        - counts_by_kind
      title: DependenciesResponse
    DependencyEdge:
      properties:
        kind:
          type: string
          enum:
            - event
            - event_type
            - field
            - variable
            - metric
            - fact_table
            - alert_rule
            - relation
            - scan_config
            - detection_override
          title: Kind
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        relation:
          type: string
          title: Relation
        certainty:
          type: string
          enum:
            - direct
            - possible
          title: Certainty
        url_hint:
          anyOf:
            - type: string
            - type: 'null'
          title: Url Hint
        depth:
          type: integer
          title: Depth
          default: 1
      type: object
      required:
        - kind
        - id
        - name
        - relation
        - certainty
      title: DependencyEdge
    DependencyEntity:
      properties:
        kind:
          type: string
          enum:
            - event
            - event_type
            - field
            - variable
            - metric
            - fact_table
            - alert_rule
            - relation
          title: Kind
        id:
          type: string
          format: uuid
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        exists:
          type: boolean
          title: Exists
          default: true
      type: object
      required:
        - kind
        - id
      title: DependencyEntity
    DetectionResetPeriod:
      properties:
        before:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Before
        after:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: After
        dry_run:
          type: boolean
          title: Dry Run
          default: false
      type: object
      title: DetectionResetPeriod
      description: >-
        Optional half-open window (``after <= t < before``) for a danger-zone
        reset.


        Both bounds are optional; omitting both clears the whole project.


        ``dry_run`` returns the counts the reset WOULD delete and deletes
        nothing, so

        the confirm dialog can name them. It defaults to false, unlike

        ``VariableRetirementRequest``: this body predates it, and a client that

        omits it has always meant "delete".
    DistributionDriftBand:
      type: string
      enum:
        - stable
        - minor
        - significant
      title: DistributionDriftBand
    DistributionDriftPoint:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        field_name:
          type: string
          title: Field Name
        bucket:
          type: string
          format: date-time
          title: Bucket
        psi:
          type: number
          title: Psi
        band:
          $ref: '#/components/schemas/DistributionDriftBand'
        baseline_total:
          type: integer
          title: Baseline Total
        current_total:
          type: integer
          title: Current Total
        top_movers:
          items:
            $ref: '#/components/schemas/DistributionDriftTopMover'
          type: array
          title: Top Movers
      type: object
      required:
        - id
        - scan_config_id
        - field_name
        - bucket
        - psi
        - band
        - baseline_total
        - current_total
        - top_movers
      title: DistributionDriftPoint
    DistributionDriftTopMover:
      properties:
        value:
          type: string
          title: Value
        baseline_share:
          type: number
          title: Baseline Share
        current_share:
          type: number
          title: Current Share
        contribution:
          type: number
          title: Contribution
      type: object
      required:
        - value
        - baseline_share
        - current_share
        - contribution
      title: DistributionDriftTopMover
    DistributionDriftsResponse:
      properties:
        scope:
          type: string
          title: Scope
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        fields:
          items:
            type: string
          type: array
          title: Fields
        data:
          items:
            $ref: '#/components/schemas/DistributionDriftPoint'
          type: array
          title: Data
      type: object
      required:
        - scope
        - fields
        - data
      title: DistributionDriftsResponse
    DocBacklinkItem:
      properties:
        scope:
          type: string
          enum:
            - project
            - organization
          title: Scope
        path:
          type: string
          title: Path
        title:
          type: string
          title: Title
        description:
          type: string
          title: Description
          default: ''
        audience:
          type: string
          enum:
            - human
            - agent
            - both
          title: Audience
          default: both
        link_raw:
          type: string
          title: Link Raw
      type: object
      required:
        - scope
        - path
        - title
        - link_raw
      title: DocBacklinkItem
    DocBacklinksResponse:
      properties:
        kind:
          type: string
          enum:
            - event
            - event_type
            - field
            - doc
            - variable
            - metric
            - alert_rule
            - branch
            - scan
            - data_source
            - user
          title: Kind
        name:
          type: string
          title: Name
        qualifier:
          anyOf:
            - type: string
            - type: 'null'
          title: Qualifier
        items:
          items:
            $ref: '#/components/schemas/DocBacklinkItem'
          type: array
          title: Items
      type: object
      required:
        - kind
        - name
        - items
      title: DocBacklinksResponse
    DocBundle:
      properties:
        format:
          type: string
          const: tripl-docs/v1
          title: Format
          default: tripl-docs/v1
        scope:
          type: string
          enum:
            - project
            - organization
          title: Scope
        project_slug:
          type: string
          title: Project Slug
        organization_slug:
          anyOf:
            - type: string
            - type: 'null'
          title: Organization Slug
        exported_at:
          type: string
          format: date-time
          title: Exported At
        files:
          items:
            $ref: '#/components/schemas/DocBundleFile'
          type: array
          title: Files
      type: object
      required:
        - scope
        - project_slug
        - exported_at
        - files
      title: DocBundle
    DocBundleFile:
      properties:
        path:
          type: string
          maxLength: 1024
          minLength: 1
          title: Path
        content:
          type: string
          title: Content
        sha256:
          anyOf:
            - type: string
            - type: 'null'
          title: Sha256
        translation_of:
          anyOf:
            - type: string
              maxLength: 1024
            - type: 'null'
          title: Translation Of
        lang:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Lang
      type: object
      required:
        - path
        - content
      title: DocBundleFile
    DocFileResponse:
      properties:
        scope:
          type: string
          enum:
            - project
            - organization
          title: Scope
        path:
          type: string
          title: Path
        title:
          type: string
          title: Title
        description:
          type: string
          title: Description
          default: ''
        tags:
          items:
            type: string
          type: array
          title: Tags
          default: []
        audience:
          type: string
          enum:
            - human
            - agent
            - both
          title: Audience
          default: both
        revision:
          type: integer
          title: Revision
        size_bytes:
          type: integer
          title: Size Bytes
        updated_at:
          type: string
          format: date-time
          title: Updated At
        updated_by_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated By Name
        visibility:
          type: string
          enum:
            - private
            - restricted
            - level
          title: Visibility
          default: level
        my_permission:
          type: string
          enum:
            - view
            - edit
          title: My Permission
          default: view
        shared:
          type: boolean
          title: Shared
          default: false
        id:
          type: string
          format: uuid
          title: Id
        content:
          type: string
          title: Content
        body:
          type: string
          title: Body
        extra_frontmatter:
          additionalProperties: true
          type: object
          title: Extra Frontmatter
          default: {}
        links:
          items:
            $ref: '#/components/schemas/DocLinkResolution'
          type: array
          title: Links
          default: []
        linked_from:
          items:
            $ref: '#/components/schemas/DocBacklinkItem'
          type: array
          title: Linked From
          default: []
        created_at:
          type: string
          format: date-time
          title: Created At
        created_by_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By Name
        break_glass:
          type: boolean
          title: Break Glass
          default: false
        lang:
          anyOf:
            - type: string
            - type: 'null'
          title: Lang
        requested_lang:
          anyOf:
            - type: string
            - type: 'null'
          title: Requested Lang
        translation_fallback:
          anyOf:
            - type: string
              enum:
                - missing
                - pending
                - failed
                - outdated
            - type: 'null'
          title: Translation Fallback
        translation_outdated:
          type: boolean
          title: Translation Outdated
          default: false
        translations:
          items:
            $ref: '#/components/schemas/DocTranslationSummary'
          type: array
          title: Translations
          default: []
        language_defaults:
          $ref: '#/components/schemas/DocLanguageDefaults'
      type: object
      required:
        - scope
        - path
        - title
        - revision
        - size_bytes
        - updated_at
        - id
        - content
        - body
        - created_at
      title: DocFileResponse
    DocFolderDeleteResponse:
      properties:
        deleted:
          items:
            type: string
          type: array
          title: Deleted
      type: object
      required:
        - deleted
      title: DocFolderDeleteResponse
    DocImportError:
      properties:
        path:
          type: string
          title: Path
        detail:
          type: string
          title: Detail
      type: object
      required:
        - path
        - detail
      title: DocImportError
    DocImportRequest:
      properties:
        format:
          type: string
          const: tripl-docs/v1
          title: Format
          default: tripl-docs/v1
        files:
          items:
            $ref: '#/components/schemas/DocBundleFile'
          type: array
          maxItems: 2000
          title: Files
      type: object
      required:
        - files
      title: DocImportRequest
    DocImportResult:
      properties:
        scope:
          type: string
          enum:
            - project
            - organization
          title: Scope
        mode:
          type: string
          enum:
            - merge
            - mirror
          title: Mode
        dry_run:
          type: boolean
          title: Dry Run
        created:
          items:
            type: string
          type: array
          title: Created
          default: []
        updated:
          items:
            type: string
          type: array
          title: Updated
          default: []
        unchanged:
          items:
            type: string
          type: array
          title: Unchanged
          default: []
        deleted:
          items:
            type: string
          type: array
          title: Deleted
          default: []
        skipped:
          items:
            $ref: '#/components/schemas/DocImportSkipped'
          type: array
          title: Skipped
          default: []
        errors:
          items:
            $ref: '#/components/schemas/DocImportError'
          type: array
          title: Errors
          default: []
        translations:
          items:
            type: string
          type: array
          title: Translations
          default: []
        translations_deleted:
          items:
            type: string
          type: array
          title: Translations Deleted
          default: []
      type: object
      required:
        - scope
        - mode
        - dry_run
      title: DocImportResult
    DocImportSkipped:
      properties:
        path:
          type: string
          title: Path
        reason:
          type: string
          title: Reason
      type: object
      required:
        - path
        - reason
      title: DocImportSkipped
    DocLanguageDefaults:
      properties:
        agent_lang:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Lang
        human_lang:
          anyOf:
            - type: string
            - type: 'null'
          title: Human Lang
      type: object
      title: DocLanguageDefaults
      description: 'The project''s default languages (lowercase BCP 47); None: the original.'
    DocLanguageDefaultsUpdate:
      properties:
        agent_lang:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Agent Lang
        human_lang:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: Human Lang
      type: object
      title: DocLanguageDefaultsUpdate
      description: 'Codes or names (``en``, ``English``); null or empty: the original.'
    DocLimits:
      properties:
        max_file_bytes:
          type: integer
          title: Max File Bytes
        max_files_per_scope:
          type: integer
          title: Max Files Per Scope
        max_bundle_files:
          type: integer
          title: Max Bundle Files
        max_bundle_bytes:
          type: integer
          title: Max Bundle Bytes
      type: object
      required:
        - max_file_bytes
        - max_files_per_scope
        - max_bundle_files
        - max_bundle_bytes
      title: DocLimits
    DocLinkResolution:
      properties:
        kind:
          type: string
          enum:
            - event
            - event_type
            - field
            - doc
            - variable
            - metric
            - alert_rule
            - branch
            - scan
            - data_source
            - user
          title: Kind
        target:
          type: string
          title: Target
        qualifier:
          anyOf:
            - type: string
            - type: 'null'
          title: Qualifier
        raw:
          type: string
          title: Raw
        status:
          type: string
          enum:
            - resolved
            - ambiguous
            - broken
            - unavailable
          title: Status
        route_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Route Path
        entity_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Entity Id
        candidates:
          type: integer
          title: Candidates
          default: 0
        label:
          anyOf:
            - type: string
            - type: 'null'
          title: Label
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
        reason:
          anyOf:
            - type: string
              enum:
                - not_found
                - invalid_id
                - path_form
                - not_a_member
            - type: 'null'
          title: Reason
        suggestions:
          items:
            type: string
          type: array
          title: Suggestions
          default: []
      type: object
      required:
        - kind
        - target
        - raw
        - status
      title: DocLinkResolution
    DocLinkSuggestion:
      properties:
        kind:
          type: string
          enum:
            - event
            - event_type
            - field
            - doc
            - variable
            - metric
            - alert_rule
            - branch
            - scan
            - data_source
            - user
          title: Kind
        id:
          type: string
          format: uuid
          title: Id
        label:
          type: string
          title: Label
        detail:
          type: string
          title: Detail
          default: ''
        insert:
          type: string
          title: Insert
      type: object
      required:
        - kind
        - id
        - label
        - insert
      title: DocLinkSuggestion
      description: One autocomplete candidate of ``GET /docs/link-suggestions``.
    DocLinkSuggestionsResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/DocLinkSuggestion'
          type: array
          title: Items
      type: object
      required:
        - items
      title: DocLinkSuggestionsResponse
    DocMoveRequest:
      properties:
        scope:
          type: string
          enum:
            - project
            - organization
          title: Scope
        from_path:
          type: string
          maxLength: 1024
          minLength: 1
          title: From Path
        to_path:
          type: string
          maxLength: 1024
          minLength: 1
          title: To Path
        folder:
          type: boolean
          title: Folder
          default: false
      type: object
      required:
        - scope
        - from_path
        - to_path
      title: DocMoveRequest
    DocMoveResponse:
      properties:
        moved:
          items:
            $ref: '#/components/schemas/DocMovedPath'
          type: array
          title: Moved
      type: object
      required:
        - moved
      title: DocMoveResponse
    DocMovedPath:
      properties:
        from_path:
          type: string
          title: From Path
        to_path:
          type: string
          title: To Path
      type: object
      required:
        - from_path
        - to_path
      title: DocMovedPath
    DocRestoreRequest:
      properties:
        message:
          type: string
          maxLength: 500
          title: Message
          default: ''
      type: object
      title: DocRestoreRequest
    DocRevisionDetail:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        number:
          type: integer
          title: Number
        action:
          type: string
          enum:
            - create
            - update
            - move
            - restore
            - import
          title: Action
        path:
          type: string
          title: Path
        message:
          type: string
          title: Message
        author_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Name
        created_at:
          type: string
          format: date-time
          title: Created At
        content_sha256:
          type: string
          title: Content Sha256
        size_bytes:
          type: integer
          title: Size Bytes
        restored_from_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Restored From Number
        content:
          type: string
          title: Content
        diff:
          type: string
          title: Diff
        diff_truncated:
          type: boolean
          title: Diff Truncated
          default: false
      type: object
      required:
        - id
        - number
        - action
        - path
        - message
        - created_at
        - content_sha256
        - size_bytes
        - content
        - diff
      title: DocRevisionDetail
    DocRevisionListResponse:
      properties:
        scope:
          type: string
          enum:
            - project
            - organization
          title: Scope
        path:
          type: string
          title: Path
        current_revision:
          type: integer
          title: Current Revision
        items:
          items:
            $ref: '#/components/schemas/DocRevisionSummary'
          type: array
          title: Items
      type: object
      required:
        - scope
        - path
        - current_revision
        - items
      title: DocRevisionListResponse
    DocRevisionSummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        number:
          type: integer
          title: Number
        action:
          type: string
          enum:
            - create
            - update
            - move
            - restore
            - import
          title: Action
        path:
          type: string
          title: Path
        message:
          type: string
          title: Message
        author_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Name
        created_at:
          type: string
          format: date-time
          title: Created At
        content_sha256:
          type: string
          title: Content Sha256
        size_bytes:
          type: integer
          title: Size Bytes
        restored_from_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Restored From Number
      type: object
      required:
        - id
        - number
        - action
        - path
        - message
        - created_at
        - content_sha256
        - size_bytes
      title: DocRevisionSummary
    DocSearchHit:
      properties:
        scope:
          type: string
          enum:
            - project
            - organization
          title: Scope
        path:
          type: string
          title: Path
        title:
          type: string
          title: Title
        description:
          type: string
          title: Description
          default: ''
        tags:
          items:
            type: string
          type: array
          title: Tags
          default: []
        audience:
          type: string
          enum:
            - human
            - agent
            - both
          title: Audience
          default: both
        snippet:
          type: string
          title: Snippet
          default: ''
        score:
          type: number
          title: Score
        confidence:
          type: number
          title: Confidence
          default: 0
      type: object
      required:
        - scope
        - path
        - title
        - score
      title: DocSearchHit
    DocSearchResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/DocSearchHit'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        truncated:
          type: boolean
          title: Truncated
          default: false
        semantic_used:
          type: boolean
          title: Semantic Used
          default: false
      type: object
      required:
        - items
        - total
      title: DocSearchResponse
    DocShareInput:
      properties:
        principal_type:
          type: string
          enum:
            - user
            - group
          title: Principal Type
        principal_id:
          type: string
          format: uuid
          title: Principal Id
        permission:
          type: string
          enum:
            - view
            - edit
          title: Permission
          default: view
      type: object
      required:
        - principal_type
        - principal_id
      title: DocShareInput
    DocShareItem:
      properties:
        principal_type:
          type: string
          enum:
            - user
            - group
          title: Principal Type
        principal_id:
          type: string
          format: uuid
          title: Principal Id
        name:
          type: string
          title: Name
          default: ''
        permission:
          type: string
          enum:
            - view
            - edit
          title: Permission
          default: view
      type: object
      required:
        - principal_type
        - principal_id
      title: DocShareItem
    DocSharingResponse:
      properties:
        scope:
          type: string
          enum:
            - project
            - organization
          title: Scope
        path:
          type: string
          title: Path
        visibility:
          type: string
          enum:
            - private
            - restricted
            - level
          title: Visibility
        inherited:
          type: boolean
          title: Inherited
        inherited_from:
          anyOf:
            - type: string
            - type: 'null'
          title: Inherited From
        shares:
          items:
            $ref: '#/components/schemas/DocShareItem'
          type: array
          title: Shares
          default: []
        can_manage:
          type: boolean
          title: Can Manage
          default: false
      type: object
      required:
        - scope
        - path
        - visibility
        - inherited
      title: DocSharingResponse
      description: >-
        A note's or a folder's sharing.


        ``inherited`` is true when it follows the nearest folder setting above
        it,

        named by ``inherited_from`` (``None`` when no folder has one and the
        default,

        ``level``, applies). ``visibility`` and ``shares`` are then the
        folder's.
    DocSharingUpdate:
      properties:
        visibility:
          type: string
          enum:
            - private
            - restricted
            - level
          title: Visibility
          default: level
        inherited:
          type: boolean
          title: Inherited
          default: false
        shares:
          items:
            $ref: '#/components/schemas/DocShareInput'
          type: array
          maxItems: 200
          title: Shares
          default: []
      type: object
      title: DocSharingUpdate
      description: >-
        ``inherited: true`` drops the note's (or folder's) own setting and
        shares.
    DocSummary:
      properties:
        scope:
          type: string
          enum:
            - project
            - organization
          title: Scope
        path:
          type: string
          title: Path
        title:
          type: string
          title: Title
        description:
          type: string
          title: Description
          default: ''
        tags:
          items:
            type: string
          type: array
          title: Tags
          default: []
        audience:
          type: string
          enum:
            - human
            - agent
            - both
          title: Audience
          default: both
        revision:
          type: integer
          title: Revision
        size_bytes:
          type: integer
          title: Size Bytes
        updated_at:
          type: string
          format: date-time
          title: Updated At
        updated_by_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated By Name
        visibility:
          type: string
          enum:
            - private
            - restricted
            - level
          title: Visibility
          default: level
        my_permission:
          type: string
          enum:
            - view
            - edit
          title: My Permission
          default: view
        shared:
          type: boolean
          title: Shared
          default: false
      type: object
      required:
        - scope
        - path
        - title
        - revision
        - size_bytes
        - updated_at
      title: DocSummary
    DocTranslateRequest:
      properties:
        scope:
          type: string
          enum:
            - project
            - organization
          title: Scope
        path:
          type: string
          maxLength: 1024
          minLength: 1
          title: Path
        language:
          type: string
          maxLength: 64
          minLength: 1
          title: Language
        overwrite:
          type: boolean
          title: Overwrite
          default: false
      type: object
      required:
        - scope
        - path
        - language
      title: DocTranslateRequest
    DocTranslationRevisionDetail:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        number:
          type: integer
          title: Number
        action:
          type: string
          enum:
            - translate
            - edit
            - restore
          title: Action
        source_revision:
          type: integer
          title: Source Revision
        author_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Name
        created_at:
          type: string
          format: date-time
          title: Created At
        content:
          type: string
          title: Content
      type: object
      required:
        - id
        - number
        - action
        - source_revision
        - created_at
        - content
      title: DocTranslationRevisionDetail
    DocTranslationRevisionSummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        number:
          type: integer
          title: Number
        action:
          type: string
          enum:
            - translate
            - edit
            - restore
          title: Action
        source_revision:
          type: integer
          title: Source Revision
        author_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Name
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - number
        - action
        - source_revision
        - created_at
      title: DocTranslationRevisionSummary
    DocTranslationSummary:
      properties:
        lang:
          type: string
          title: Lang
        status:
          type: string
          enum:
            - pending
            - ready
            - failed
          title: Status
        revision:
          type: integer
          title: Revision
        source_revision:
          type: integer
          title: Source Revision
        outdated:
          type: boolean
          title: Outdated
        machine:
          type: boolean
          title: Machine
        error:
          type: string
          title: Error
          default: ''
        updated_at:
          type: string
          format: date-time
          title: Updated At
        updated_by_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated By Name
      type: object
      required:
        - lang
        - status
        - revision
        - source_revision
        - outdated
        - machine
        - updated_at
      title: DocTranslationSummary
    DocTranslationWrite:
      properties:
        scope:
          type: string
          enum:
            - project
            - organization
          title: Scope
        path:
          type: string
          maxLength: 1024
          minLength: 1
          title: Path
        lang:
          type: string
          maxLength: 64
          minLength: 1
          title: Lang
        content:
          type: string
          maxLength: 3145728
          title: Content
        base_revision:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Base Revision
        mark_current:
          type: boolean
          title: Mark Current
          default: false
      type: object
      required:
        - scope
        - path
        - lang
        - content
      title: DocTranslationWrite
    DocTreeOrganization:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        slug:
          type: string
          title: Slug
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - slug
        - name
      title: DocTreeOrganization
    DocTreeProject:
      properties:
        slug:
          type: string
          title: Slug
        name:
          type: string
          title: Name
      type: object
      required:
        - slug
        - name
      title: DocTreeProject
    DocTreeResponse:
      properties:
        project:
          $ref: '#/components/schemas/DocTreeProject'
        organization:
          $ref: '#/components/schemas/DocTreeOrganization'
        project_docs:
          items:
            $ref: '#/components/schemas/DocSummary'
          type: array
          title: Project Docs
        organization_docs:
          items:
            $ref: '#/components/schemas/DocSummary'
          type: array
          title: Organization Docs
        limits:
          $ref: '#/components/schemas/DocLimits'
        language_defaults:
          $ref: '#/components/schemas/DocLanguageDefaults'
      type: object
      required:
        - project
        - organization
        - project_docs
        - organization_docs
        - limits
      title: DocTreeResponse
    DocWriteRequest:
      properties:
        content:
          type: string
          maxLength: 1048576
          title: Content
        base_revision:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Base Revision
        create_only:
          type: boolean
          title: Create Only
          default: false
        message:
          type: string
          maxLength: 500
          title: Message
          default: ''
      type: object
      required:
        - content
      title: DocWriteRequest
    DocWriteResponse:
      properties:
        scope:
          type: string
          enum:
            - project
            - organization
          title: Scope
        path:
          type: string
          title: Path
        title:
          type: string
          title: Title
        description:
          type: string
          title: Description
          default: ''
        tags:
          items:
            type: string
          type: array
          title: Tags
          default: []
        audience:
          type: string
          enum:
            - human
            - agent
            - both
          title: Audience
          default: both
        revision:
          type: integer
          title: Revision
        size_bytes:
          type: integer
          title: Size Bytes
        updated_at:
          type: string
          format: date-time
          title: Updated At
        updated_by_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated By Name
        visibility:
          type: string
          enum:
            - private
            - restricted
            - level
          title: Visibility
          default: level
        my_permission:
          type: string
          enum:
            - view
            - edit
          title: My Permission
          default: view
        shared:
          type: boolean
          title: Shared
          default: false
        id:
          type: string
          format: uuid
          title: Id
        content:
          type: string
          title: Content
        body:
          type: string
          title: Body
        extra_frontmatter:
          additionalProperties: true
          type: object
          title: Extra Frontmatter
          default: {}
        links:
          items:
            $ref: '#/components/schemas/DocLinkResolution'
          type: array
          title: Links
          default: []
        linked_from:
          items:
            $ref: '#/components/schemas/DocBacklinkItem'
          type: array
          title: Linked From
          default: []
        created_at:
          type: string
          format: date-time
          title: Created At
        created_by_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By Name
        break_glass:
          type: boolean
          title: Break Glass
          default: false
        lang:
          anyOf:
            - type: string
            - type: 'null'
          title: Lang
        requested_lang:
          anyOf:
            - type: string
            - type: 'null'
          title: Requested Lang
        translation_fallback:
          anyOf:
            - type: string
              enum:
                - missing
                - pending
                - failed
                - outdated
            - type: 'null'
          title: Translation Fallback
        translation_outdated:
          type: boolean
          title: Translation Outdated
          default: false
        translations:
          items:
            $ref: '#/components/schemas/DocTranslationSummary'
          type: array
          title: Translations
          default: []
        language_defaults:
          $ref: '#/components/schemas/DocLanguageDefaults'
        created:
          type: boolean
          title: Created
        changed:
          type: boolean
          title: Changed
        warnings:
          items:
            type: string
          type: array
          title: Warnings
          default: []
      type: object
      required:
        - scope
        - path
        - title
        - revision
        - size_bytes
        - updated_at
        - id
        - content
        - body
        - created_at
        - created
        - changed
      title: DocWriteResponse
    DriftResetCounts:
      properties:
        schema_drifts:
          type: integer
          title: Schema Drifts
        distribution_drifts:
          type: integer
          title: Distribution Drifts
      type: object
      required:
        - schema_drifts
        - distribution_drifts
      title: DriftResetCounts
    DuplicateCandidateIn:
      properties:
        name:
          type: string
          maxLength: 500
          title: Name
          default: ''
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        description:
          anyOf:
            - type: string
              maxLength: 10000
            - type: 'null'
          title: Description
        field_values:
          items:
            $ref: '#/components/schemas/EventFieldValueIn'
          type: array
          maxItems: 500
          title: Field Values
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
      type: object
      required:
        - event_type_id
      title: DuplicateCandidateIn
    DuplicateCheckRequest:
      properties:
        candidates:
          items:
            $ref: '#/components/schemas/DuplicateCandidateIn'
          type: array
          maxItems: 500
          minItems: 1
          title: Candidates
      type: object
      required:
        - candidates
      title: DuplicateCheckRequest
    DuplicateCheckResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/DuplicateCheckResult'
          type: array
          title: Items
        threshold:
          type: number
          title: Threshold
        semantic_used:
          type: boolean
          title: Semantic Used
          default: false
      type: object
      required:
        - items
        - threshold
      title: DuplicateCheckResponse
    DuplicateCheckResult:
      properties:
        name:
          type: string
          title: Name
        duplicates:
          items:
            $ref: '#/components/schemas/DuplicateHit'
          type: array
          title: Duplicates
        lint:
          items:
            $ref: '#/components/schemas/NameLintIssue'
          type: array
          title: Lint
        suggestion:
          anyOf:
            - type: string
            - type: 'null'
          title: Suggestion
        lint_applicable:
          type: boolean
          title: Lint Applicable
          default: true
        convention:
          anyOf:
            - $ref: '#/components/schemas/NamingConventionOut'
            - type: 'null'
      type: object
      required:
        - name
      title: DuplicateCheckResult
    DuplicateCluster:
      properties:
        events:
          items:
            $ref: '#/components/schemas/DuplicateClusterEvent'
          type: array
          title: Events
        score:
          type: number
          title: Score
      type: object
      required:
        - events
        - score
      title: DuplicateCluster
    DuplicateClusterEvent:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        status:
          type: string
          title: Status
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        volume_7d:
          type: integer
          title: Volume 7D
          default: 0
      type: object
      required:
        - id
        - name
        - status
        - event_type_id
      title: DuplicateClusterEvent
    DuplicateClusterPage:
      properties:
        items:
          items:
            $ref: '#/components/schemas/DuplicateCluster'
          type: array
          title: Items
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
        total:
          type: integer
          title: Total
        threshold:
          type: number
          title: Threshold
        truncated:
          type: boolean
          title: Truncated
          default: false
      type: object
      required:
        - items
        - total
        - threshold
      title: DuplicateClusterPage
    DuplicateDismissRequest:
      properties:
        event_a_id:
          type: string
          format: uuid
          title: Event A Id
        event_b_id:
          type: string
          format: uuid
          title: Event B Id
      type: object
      required:
        - event_a_id
        - event_b_id
      title: DuplicateDismissRequest
    DuplicateDismissResponse:
      properties:
        event_a_id:
          type: string
          format: uuid
          title: Event A Id
        event_b_id:
          type: string
          format: uuid
          title: Event B Id
        created:
          type: boolean
          title: Created
      type: object
      required:
        - event_a_id
        - event_b_id
        - created
      title: DuplicateDismissResponse
    DuplicateHit:
      properties:
        event_id:
          type: string
          format: uuid
          title: Event Id
        name:
          type: string
          title: Name
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        status:
          type: string
          title: Status
        score:
          type: number
          title: Score
        reasons:
          items:
            type: string
          type: array
          title: Reasons
      type: object
      required:
        - event_id
        - name
        - event_type_id
        - status
        - score
      title: DuplicateHit
    EmailSettings:
      properties:
        smtp_host:
          type: string
          title: Smtp Host
        smtp_port:
          type: integer
          title: Smtp Port
        smtp_username:
          type: string
          title: Smtp Username
        smtp_password_configured:
          type: boolean
          title: Smtp Password Configured
        smtp_security:
          type: string
          enum:
            - none
            - starttls
            - implicit_tls
          title: Smtp Security
        smtp_from_address:
          type: string
          title: Smtp From Address
      type: object
      required:
        - smtp_host
        - smtp_port
        - smtp_username
        - smtp_password_configured
        - smtp_security
        - smtp_from_address
      title: EmailSettings
    EmailSettingsTestRequest:
      properties:
        recipient:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Recipient
      type: object
      title: EmailSettingsTestRequest
    EmailSettingsUpdate:
      properties:
        smtp_host:
          anyOf:
            - type: string
            - type: 'null'
          title: Smtp Host
        smtp_port:
          anyOf:
            - type: integer
              maximum: 65535
              minimum: 1
            - type: 'null'
          title: Smtp Port
        smtp_username:
          anyOf:
            - type: string
            - type: 'null'
          title: Smtp Username
        smtp_password:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
          title: Smtp Password
        smtp_security:
          anyOf:
            - type: string
              enum:
                - none
                - starttls
                - implicit_tls
            - type: 'null'
          title: Smtp Security
        smtp_from_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Smtp From Address
      type: object
      title: EmailSettingsUpdate
    EntityChangeCount:
      properties:
        entity_type:
          type: string
          enum:
            - event_type
            - field_definition
            - event
            - variable
            - meta_field
            - relation
          title: Entity Type
        added:
          type: integer
          title: Added
          default: 0
        changed:
          type: integer
          title: Changed
          default: 0
        removed:
          type: integer
          title: Removed
          default: 0
        renamed:
          type: integer
          title: Renamed
          default: 0
      type: object
      required:
        - entity_type
      title: EntityChangeCount
      description: How many entities of one type a side added, changed, removed or renamed.
    EventBulkDelete:
      properties:
        event_ids:
          items:
            type: string
            format: uuid
          type: array
          minItems: 1
          title: Event Ids
      type: object
      required:
        - event_ids
      title: EventBulkDelete
    EventBulkUpdate:
      properties:
        event_ids:
          items:
            type: string
            format: uuid
          type: array
          minItems: 1
          title: Event Ids
        status:
          anyOf:
            - $ref: '#/components/schemas/EventStatus'
            - type: 'null'
        sunset_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sunset At
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Reviewed
      type: object
      required:
        - event_ids
      title: EventBulkUpdate
    EventChangeResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        event_id:
          type: string
          format: uuid
          title: Event Id
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
        user_email:
          anyOf:
            - type: string
            - type: 'null'
          title: User Email
        author_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Label
        field:
          type: string
          title: Field
        old_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Old Value
        new_value:
          anyOf:
            - type: string
            - type: 'null'
          title: New Value
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - event_id
        - field
        - created_at
      title: EventChangeResponse
    EventCommentActionRequest:
      properties:
        action:
          type: string
          enum:
            - resolve
            - snooze
            - reopen
          title: Action
        note:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Note
        snoozed_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Snoozed Until
      type: object
      required:
        - action
      title: EventCommentActionRequest
      description: >-
        One action on one thread, shaped like ``SchemaDriftActionRequest``.


        POST to an ``/actions`` sub-resource rather than PATCH on the comment,
        the

        way every other resolvable thing in this codebase does it: the body
        names an

        intent, and the five columns it moves are the service's business, not
        the

        client's.
    EventCommentStatus:
      type: string
      enum:
        - open
        - resolved
        - snoozed
      title: EventCommentStatus
      description: >-
        Resolution state of one discussion thread on an event.


        The five columns come from ``SchemaDrift``, but not its vocabulary:

        ``accepted`` and ``false_positive`` are verdicts a detector's finding
        earns,

        and a question someone typed is neither accepted nor false. A thread is

        open, answered, or deliberately parked.
    EventCompositionMetricCreate:
      properties:
        kind:
          type: string
          const: event_composition
          title: Kind
          default: event_composition
        composition:
          $ref: '#/components/schemas/MetricComposition'
        numerator_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Numerator Event Id
        numerator_event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Numerator Event Type Id
        denominator_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Denominator Event Id
        denominator_event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Denominator Event Type Id
        user_id_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: User Id Column
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        display_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Display Name
        description:
          type: string
          title: Description
          default: ''
        color:
          type: string
          pattern: ^#[0-9a-fA-F]{6}$
          title: Color
          default: '#6366f1'
        order:
          anyOf:
            - type: integer
            - type: 'null'
          title: Order
        unit:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Unit
        status:
          $ref: '#/components/schemas/MetricStatus'
          default: draft
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          type: boolean
          title: Reviewed
          default: false
        breakdown_columns:
          items:
            type: string
          type: array
          title: Breakdown Columns
        breakdown_values_limit:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Breakdown Values Limit
        app_version_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: App Version Column
        platform_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Platform Column
        anomaly_detection_enabled:
          type: boolean
          title: Anomaly Detection Enabled
          default: true
      type: object
      required:
        - composition
        - name
        - display_name
      title: EventCompositionMetricCreate
    EventCompositionMetricDefinition:
      properties:
        kind:
          type: string
          const: event_composition
          title: Kind
          default: event_composition
        composition:
          $ref: '#/components/schemas/MetricComposition'
        numerator_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Numerator Event Id
        numerator_event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Numerator Event Type Id
        denominator_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Denominator Event Id
        denominator_event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Denominator Event Type Id
        user_id_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: User Id Column
      type: object
      required:
        - composition
      title: EventCompositionMetricDefinition
      description: >-
        Kind + config for an ``event_composition`` metric; no data source /
        interval.


        Numerator/denominator are each given as exactly one ref: an ``event_id``
        or

        an ``event_type_id``. ``single``/``per_distinct_user`` use the numerator

        only; ``ratio`` requires both numerator and denominator.
    EventCreate:
      properties:
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        name:
          type: string
          maxLength: 500
          minLength: 1
          title: Name
        title:
          type: string
          maxLength: 500
          title: Title
          default: ''
        description:
          type: string
          title: Description
          default: ''
        status:
          $ref: '#/components/schemas/EventStatus'
          default: draft
        sunset_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sunset At
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          type: boolean
          title: Reviewed
          default: false
        metric_breakdown_columns:
          items:
            type: string
          type: array
          title: Metric Breakdown Columns
          default: []
        required_presence_threshold:
          anyOf:
            - type: number
              maximum: 1
              exclusiveMinimum: 0
            - type: 'null'
          title: Required Presence Threshold
        tags:
          items:
            type: string
          type: array
          title: Tags
          default: []
        field_values:
          items:
            $ref: '#/components/schemas/EventFieldValueIn'
          type: array
          title: Field Values
          default: []
        meta_values:
          items:
            $ref: '#/components/schemas/EventMetaValueIn'
          type: array
          title: Meta Values
          default: []
      type: object
      required:
        - event_type_id
        - name
      title: EventCreate
    EventFieldValueIn:
      properties:
        field_definition_id:
          type: string
          format: uuid
          title: Field Definition Id
        value:
          type: string
          maxLength: 100000
          title: Value
      type: object
      required:
        - field_definition_id
        - value
      title: EventFieldValueIn
    EventFieldValueResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        field_definition_id:
          type: string
          format: uuid
          title: Field Definition Id
        value:
          type: string
          title: Value
        is_authored:
          type: boolean
          title: Is Authored
          default: false
        variable_values:
          items:
            $ref: '#/components/schemas/EventFieldVariableValueResponse'
          type: array
          title: Variable Values
          default: []
      type: object
      required:
        - id
        - field_definition_id
        - value
      title: EventFieldValueResponse
    EventFieldVariableValueResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        variable_id:
          type: string
          format: uuid
          title: Variable Id
        variable_name:
          type: string
          title: Variable Name
        source_column:
          type: string
          title: Source Column
        value_kind:
          $ref: '#/components/schemas/VariableValueKind'
        observed_count:
          type: integer
          title: Observed Count
        values:
          items:
            type: string
          type: array
          title: Values
          default: []
        updated_at:
          type: string
          format: date-time
          title: Updated At
        excluded_from_scans:
          type: boolean
          title: Excluded From Scans
          default: false
      type: object
      required:
        - id
        - variable_id
        - variable_name
        - source_column
        - value_kind
        - observed_count
        - updated_at
      title: EventFieldVariableValueResponse
    EventGroupCondition:
      properties:
        field:
          type: string
          maxLength: 255
          minLength: 1
          title: Field
        pattern:
          type: string
          maxLength: 500
          minLength: 1
          title: Pattern
      type: object
      required:
        - field
        - pattern
      title: EventGroupCondition
    EventGroupRule:
      properties:
        name:
          type: string
          maxLength: 500
          minLength: 1
          title: Name
        condition_logic:
          type: string
          enum:
            - all
            - any
          title: Condition Logic
          default: all
        conditions:
          items:
            $ref: '#/components/schemas/EventGroupCondition'
          type: array
          maxItems: 20
          minItems: 1
          title: Conditions
      type: object
      required:
        - name
        - conditions
      title: EventGroupRule
    EventHealth:
      properties:
        event_id:
          type: string
          format: uuid
          title: Event Id
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        name:
          type: string
          title: Name
        score:
          type: integer
          title: Score
        grade:
          type: string
          enum:
            - healthy
            - warning
            - unhealthy
          title: Grade
        renormalized:
          type: boolean
          title: Renormalized
        excluded:
          items:
            type: string
            enum:
              - implemented_seen
              - contract
              - drifts
              - signals
              - freshness
              - documentation
          type: array
          title: Excluded
        top_issue:
          anyOf:
            - type: string
            - type: 'null'
          title: Top Issue
        components:
          items:
            $ref: '#/components/schemas/HealthComponent'
          type: array
          title: Components
      type: object
      required:
        - event_id
        - event_type_id
        - name
        - score
        - grade
        - renormalized
        - excluded
        - components
      title: EventHealth
    EventHealthBrief:
      properties:
        event_id:
          type: string
          format: uuid
          title: Event Id
        name:
          type: string
          title: Name
        score:
          type: integer
          title: Score
        grade:
          type: string
          enum:
            - healthy
            - warning
            - unhealthy
          title: Grade
        top_issue:
          anyOf:
            - type: string
            - type: 'null'
          title: Top Issue
      type: object
      required:
        - event_id
        - name
        - score
        - grade
      title: EventHealthBrief
    EventHealthListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/EventHealth'
          type: array
          title: Items
        computed_at:
          type: string
          format: date-time
          title: Computed At
      type: object
      required:
        - items
        - computed_at
      title: EventHealthListResponse
    EventIdentityHolder:
      properties:
        identity:
          type: string
          title: Identity
        event_id:
          type: string
          format: uuid
          title: Event Id
        name:
          type: string
          title: Name
        source_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Name
      type: object
      required:
        - identity
        - event_id
        - name
        - source_name
      title: EventIdentityHolder
      description: >-
        An event that already answers to a looked-up identity.


        ``identity`` is the name that was asked about; ``name`` is the holder's
        own

        name, which differs when a scanned event has since been renamed.
    EventIdentityHoldersResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/EventIdentityHolder'
          type: array
          title: Items
      type: object
      required:
        - items
      title: EventIdentityHoldersResponse
    EventListItemResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        name:
          type: string
          title: Name
        source_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Name
        title:
          type: string
          title: Title
          default: ''
        description:
          type: string
          title: Description
        required_presence_threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Required Presence Threshold
        order:
          type: integer
          title: Order
        status:
          $ref: '#/components/schemas/EventStatus'
        sunset_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sunset At
        last_seen_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Seen At
        first_seen_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: First Seen At
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          type: boolean
          title: Reviewed
          default: false
        metric_breakdown_columns:
          items:
            type: string
          type: array
          title: Metric Breakdown Columns
          default: []
        drift_count:
          type: integer
          title: Drift Count
          default: 0
        open_question_count:
          type: integer
          title: Open Question Count
          default: 0
        monitored:
          type: boolean
          title: Monitored
          default: false
        lifecycle_warning:
          type: boolean
          title: Lifecycle Warning
          default: false
        tags:
          items:
            $ref: '#/components/schemas/EventTagResponse'
          type: array
          title: Tags
          default: []
        field_values:
          items:
            $ref: '#/components/schemas/EventFieldValueResponse'
          type: array
          title: Field Values
          default: []
        meta_values:
          items:
            $ref: '#/components/schemas/EventMetaValueResponse'
          type: array
          title: Meta Values
          default: []
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - project_id
        - event_type_id
        - name
        - description
        - order
        - status
        - created_at
        - updated_at
      title: EventListItemResponse
      description: >-
        Slim variant of EventResponse used by the list endpoint.


        Drops the nested ``event_type`` payload — the frontend already loads

        EventTypes separately and looks them up by id, so shipping the brief
        here

        is pure overhead at scale (and triggers an extra selectin SQL query).
    EventListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/EventListItemResponse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
      type: object
      required:
        - items
        - total
      title: EventListResponse
    EventMetaValueIn:
      properties:
        meta_field_definition_id:
          type: string
          format: uuid
          title: Meta Field Definition Id
        value:
          type: string
          maxLength: 8000
          title: Value
      type: object
      required:
        - meta_field_definition_id
        - value
      title: EventMetaValueIn
    EventMetaValueResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        meta_field_definition_id:
          type: string
          format: uuid
          title: Meta Field Definition Id
        value:
          type: string
          title: Value
      type: object
      required:
        - id
        - meta_field_definition_id
        - value
      title: EventMetaValueResponse
    EventMetricBreakdownSeries:
      properties:
        breakdown_value:
          type: string
          title: Breakdown Value
        is_other:
          type: boolean
          title: Is Other
          default: false
        total_count:
          type: integer
          title: Total Count
        data:
          items:
            $ref: '#/components/schemas/EventMetricPoint'
          type: array
          title: Data
        parity_anomalies:
          items:
            $ref: '#/components/schemas/PlatformParityAnomaly'
          type: array
          title: Parity Anomalies
          default: []
      type: object
      required:
        - breakdown_value
        - total_count
        - data
      title: EventMetricBreakdownSeries
    EventMetricBreakdownsResponse:
      properties:
        event_id:
          type: string
          format: uuid
          title: Event Id
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        columns:
          items:
            type: string
          type: array
          title: Columns
        selected_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Selected Column
        series:
          items:
            $ref: '#/components/schemas/EventMetricBreakdownSeries'
          type: array
          title: Series
      type: object
      required:
        - event_id
        - columns
        - series
      title: EventMetricBreakdownsResponse
    EventMetricPoint:
      properties:
        bucket:
          type: string
          format: date-time
          title: Bucket
        count:
          type: integer
          title: Count
        expected_count:
          anyOf:
            - type: number
            - type: 'null'
          title: Expected Count
        stddev:
          anyOf:
            - type: number
            - type: 'null'
          title: Stddev
        detector_kind:
          anyOf:
            - type: string
            - type: 'null'
          title: Detector Kind
        is_anomaly:
          type: boolean
          title: Is Anomaly
          default: false
        anomaly_direction:
          anyOf:
            - $ref: '#/components/schemas/AnomalyDirection'
            - type: 'null'
        z_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Z Score
        verdict:
          anyOf:
            - $ref: '#/components/schemas/SignalVerdictInfo'
            - type: 'null'
        planned_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Planned Event Id
        baseline_expected:
          anyOf:
            - type: number
            - type: 'null'
          title: Baseline Expected
        baseline_stddev:
          anyOf:
            - type: number
            - type: 'null'
          title: Baseline Stddev
      type: object
      required:
        - bucket
        - count
      title: EventMetricPoint
    EventMetricsResponse:
      properties:
        scope:
          type: string
          title: Scope
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        scan_config_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Scan Config Name
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        latest_signal:
          anyOf:
            - $ref: '#/components/schemas/MetricSignalResponse'
            - type: 'null'
        sigma_threshold:
          type: number
          title: Sigma Threshold
          default: 4
        last_collected_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Collected At
        next_collection_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Next Collection At
        week_total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Week Total
        prior_week_total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Prior Week Total
        data:
          items:
            $ref: '#/components/schemas/EventMetricPoint'
          type: array
          title: Data
        forecast:
          items:
            $ref: '#/components/schemas/ForecastPoint'
          type: array
          title: Forecast
          default: []
      type: object
      required:
        - scope
        - data
      title: EventMetricsResponse
    EventMigrationResponse:
      properties:
        old:
          $ref: '#/components/schemas/EventMigrationSide'
        new:
          $ref: '#/components/schemas/EventMigrationSide'
        ratio:
          anyOf:
            - type: number
            - type: 'null'
          title: Ratio
      type: object
      required:
        - old
        - new
      title: EventMigrationResponse
      description: >-
        Successor adoption for a retired event: "Old 1,240/day → New 3,800/day".


        ``ratio`` is ``new / old`` daily volume — how many times the old event's

        volume the successor now receives (1,240 -> 3,800 is ``3.06``). Above 1
        the

        successor has overtaken the old event. Null when the old event received

        nothing in the window.
    EventMigrationSide:
      properties:
        event_id:
          type: string
          format: uuid
          title: Event Id
        name:
          type: string
          title: Name
        daily_avg_7d:
          type: number
          title: Daily Avg 7D
      type: object
      required:
        - event_id
        - name
        - daily_avg_7d
      title: EventMigrationSide
    EventMove:
      properties:
        direction:
          type: string
          enum:
            - up
            - down
          title: Direction
        visible_event_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Visible Event Ids
      type: object
      required:
        - direction
      title: EventMove
    EventMutationResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        event_type:
          $ref: '#/components/schemas/EventTypeBrief'
        name:
          type: string
          title: Name
        source_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Name
        title:
          type: string
          title: Title
          default: ''
        description:
          type: string
          title: Description
        required_presence_threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Required Presence Threshold
        order:
          type: integer
          title: Order
        status:
          $ref: '#/components/schemas/EventStatus'
        sunset_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sunset At
        superseded_by_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Superseded By Event Id
        last_seen_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Seen At
        first_seen_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: First Seen At
        main_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Main Event Id
        lifecycle_findings:
          items:
            $ref: '#/components/schemas/LifecycleFindingResponse'
          type: array
          title: Lifecycle Findings
          default: []
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          type: boolean
          title: Reviewed
          default: false
        metric_breakdown_columns:
          items:
            type: string
          type: array
          title: Metric Breakdown Columns
          default: []
        drift_count:
          type: integer
          title: Drift Count
          default: 0
        tags:
          items:
            $ref: '#/components/schemas/EventTagResponse'
          type: array
          title: Tags
          default: []
        field_values:
          items:
            $ref: '#/components/schemas/EventFieldValueResponse'
          type: array
          title: Field Values
          default: []
        meta_values:
          items:
            $ref: '#/components/schemas/EventMetaValueResponse'
          type: array
          title: Meta Values
          default: []
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        branch_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Branch Id
        warnings:
          items:
            type: string
          type: array
          title: Warnings
      type: object
      required:
        - id
        - project_id
        - event_type_id
        - event_type
        - name
        - description
        - order
        - status
        - created_at
        - updated_at
      title: EventMutationResponse
      description: >-
        Event returned after a create or update, with advisory template
        warnings.
    EventPhotoCommentCreate:
      properties:
        body:
          type: string
          maxLength: 4000
          minLength: 1
          title: Body
        parent_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Parent Id
      type: object
      required:
        - body
      title: EventPhotoCommentCreate
    EventPhotoCommentResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        photo_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Photo Id
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        parent_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Parent Id
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
        body:
          type: string
          title: Body
        status:
          $ref: '#/components/schemas/EventCommentStatus'
          default: open
        resolution_note:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolution Note
        snoozed_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Snoozed Until
        resolved_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Resolved At
        resolved_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Resolved By
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - parent_id
        - user_id
        - body
        - created_at
        - updated_at
      title: EventPhotoCommentResponse
    EventPhotoFigmaCreate:
      properties:
        url:
          type: string
          maxLength: 2000
          minLength: 1
          title: Url
        title:
          type: string
          maxLength: 500
          title: Title
          default: ''
      type: object
      required:
        - url
      title: EventPhotoFigmaCreate
      description: Attach a Figma frame/file as a design spec on this event.
    EventPhotoKind:
      type: string
      enum:
        - photo
        - figma
      title: EventPhotoKind
    EventPhotoReorder:
      properties:
        photo_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Photo Ids
      type: object
      required:
        - photo_ids
      title: EventPhotoReorder
    EventPhotoResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        event_id:
          type: string
          format: uuid
          title: Event Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        kind:
          $ref: '#/components/schemas/EventPhotoKind'
        original_filename:
          type: string
          title: Original Filename
        content_type:
          type: string
          title: Content Type
        size_bytes:
          type: integer
          title: Size Bytes
        storage_backend:
          anyOf:
            - $ref: '#/components/schemas/EventPhotoStorageBackend'
            - type: 'null'
        sort_order:
          type: integer
          title: Sort Order
        url:
          type: string
          title: Url
        external_url:
          anyOf:
            - type: string
            - type: 'null'
          title: External Url
        uploaded_by_user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Uploaded By User Id
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - event_id
        - project_id
        - kind
        - original_filename
        - content_type
        - size_bytes
        - storage_backend
        - sort_order
        - url
        - created_at
      title: EventPhotoResponse
    EventPhotoStorageBackend:
      type: string
      enum:
        - local
        - gcs
      title: EventPhotoStorageBackend
    EventPropertyResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        variable_id:
          type: string
          format: uuid
          title: Variable Id
        name:
          type: string
          title: Name
        variable_type:
          $ref: '#/components/schemas/VariableType'
        json_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Json Schema
        description:
          type: string
          title: Description
          default: ''
        required:
          type: boolean
          title: Required
          default: false
        values:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Values
          description: >-
            This event's override of the allowed values; null when there is
            none.
        effective_values:
          items:
            type: string
          type: array
          title: Effective Values
          description: >-
            The allowed values in force for this event: the override when there
            is one, else the variable's global list.
          default: []
        presence_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Presence Rate
          description: >-
            Share of this event's scanned rows that carried the property, from
            the last scan that measured it; null when unknown.
        suggested_required:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Suggested Required
          description: >-
            Whether presence_rate reaches the event's
            required_presence_threshold (default 0.95); null when presence is
            unknown. A suggestion: 'required' is only ever set by a person.
      type: object
      required:
        - id
        - variable_id
        - name
        - variable_type
      title: EventPropertyResponse
      description: One entry of an event's property list, with the variable it names.
    EventReorder:
      properties:
        event_ids:
          items:
            type: string
            format: uuid
          type: array
          minItems: 1
          title: Event Ids
      type: object
      required:
        - event_ids
      title: EventReorder
    EventResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        event_type:
          $ref: '#/components/schemas/EventTypeBrief'
        name:
          type: string
          title: Name
        source_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Name
        title:
          type: string
          title: Title
          default: ''
        description:
          type: string
          title: Description
        required_presence_threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Required Presence Threshold
        order:
          type: integer
          title: Order
        status:
          $ref: '#/components/schemas/EventStatus'
        sunset_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sunset At
        superseded_by_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Superseded By Event Id
        last_seen_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Seen At
        first_seen_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: First Seen At
        main_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Main Event Id
        lifecycle_findings:
          items:
            $ref: '#/components/schemas/LifecycleFindingResponse'
          type: array
          title: Lifecycle Findings
          default: []
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          type: boolean
          title: Reviewed
          default: false
        metric_breakdown_columns:
          items:
            type: string
          type: array
          title: Metric Breakdown Columns
          default: []
        drift_count:
          type: integer
          title: Drift Count
          default: 0
        tags:
          items:
            $ref: '#/components/schemas/EventTagResponse'
          type: array
          title: Tags
          default: []
        field_values:
          items:
            $ref: '#/components/schemas/EventFieldValueResponse'
          type: array
          title: Field Values
          default: []
        meta_values:
          items:
            $ref: '#/components/schemas/EventMetaValueResponse'
          type: array
          title: Meta Values
          default: []
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        branch_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Branch Id
      type: object
      required:
        - id
        - project_id
        - event_type_id
        - event_type
        - name
        - description
        - order
        - status
        - created_at
        - updated_at
      title: EventResponse
    EventStatus:
      type: string
      enum:
        - draft
        - in_review
        - ready_for_dev
        - implemented
        - live
        - deprecated
        - archived
      title: EventStatus
    EventTagResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - name
      title: EventTagResponse
    EventTypeBrief:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
        color:
          type: string
          title: Color
      type: object
      required:
        - id
        - name
        - display_name
        - color
      title: EventTypeBrief
    EventTypeCreate:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
        display_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Display Name
        description:
          type: string
          title: Description
          default: ''
        color:
          type: string
          pattern: ^#[0-9a-fA-F]{6}$
          title: Color
          default: '#6366f1'
        order:
          type: integer
          title: Order
          default: 0
        field_definitions:
          items:
            $ref: '#/components/schemas/FieldDefinitionCreate'
          type: array
          title: Field Definitions
      type: object
      required:
        - name
        - display_name
      title: EventTypeCreate
    EventTypeHealth:
      properties:
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        score:
          anyOf:
            - type: integer
            - type: 'null'
          title: Score
        grade:
          anyOf:
            - type: string
              enum:
                - healthy
                - warning
                - unhealthy
            - type: 'null'
          title: Grade
        scored_events:
          type: integer
          title: Scored Events
        healthy_count:
          type: integer
          title: Healthy Count
        warning_count:
          type: integer
          title: Warning Count
        unhealthy_count:
          type: integer
          title: Unhealthy Count
        component_averages:
          items:
            $ref: '#/components/schemas/ComponentAverage'
          type: array
          title: Component Averages
        worst:
          items:
            $ref: '#/components/schemas/EventHealthBrief'
          type: array
          title: Worst
      type: object
      required:
        - event_type_id
        - scored_events
        - healthy_count
        - warning_count
        - unhealthy_count
        - component_averages
        - worst
      title: EventTypeHealth
    EventTypeHealthListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/EventTypeHealth'
          type: array
          title: Items
      type: object
      required:
        - items
      title: EventTypeHealthListResponse
    EventTypeOwnerCreate:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
      type: object
      required:
        - user_id
      title: EventTypeOwnerCreate
    EventTypeOwnerResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        user_id:
          type: string
          format: uuid
          title: User Id
        user_email:
          type: string
          title: User Email
        user_name:
          type: string
          title: User Name
        granted_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Granted By
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - event_type_id
        - user_id
        - user_email
        - user_name
        - granted_by
        - created_at
      title: EventTypeOwnerResponse
    EventTypeResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
        description:
          type: string
          title: Description
        color:
          type: string
          title: Color
        order:
          type: integer
          title: Order
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        field_definitions:
          items:
            $ref: '#/components/schemas/FieldDefinitionResponse'
          type: array
          title: Field Definitions
          default: []
        event_name_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Name Format
      type: object
      required:
        - id
        - project_id
        - name
        - display_name
        - description
        - color
        - order
        - created_at
        - updated_at
      title: EventTypeResponse
    EventTypeUpdate:
      properties:
        display_name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Display Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        color:
          anyOf:
            - type: string
              pattern: ^#[0-9a-fA-F]{6}$
            - type: 'null'
          title: Color
        order:
          anyOf:
            - type: integer
            - type: 'null'
          title: Order
      type: object
      title: EventTypeUpdate
    EventUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 500
              minLength: 1
            - type: 'null'
          title: Name
        title:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Title
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        status:
          anyOf:
            - $ref: '#/components/schemas/EventStatus'
            - type: 'null'
        sunset_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Sunset At
        superseded_by_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Superseded By Event Id
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Reviewed
        metric_breakdown_columns:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Metric Breakdown Columns
        required_presence_threshold:
          anyOf:
            - type: number
              maximum: 1
              exclusiveMinimum: 0
            - type: 'null'
          title: Required Presence Threshold
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
        field_values:
          anyOf:
            - items:
                $ref: '#/components/schemas/EventFieldValueIn'
              type: array
            - type: 'null'
          title: Field Values
        meta_values:
          anyOf:
            - items:
                $ref: '#/components/schemas/EventMetaValueIn'
              type: array
            - type: 'null'
          title: Meta Values
      type: object
      title: EventUpdate
    EventWindowMetricsRequest:
      properties:
        event_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Event Ids
        time_from:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Time From
        time_to:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Time To
      type: object
      required:
        - event_ids
      title: EventWindowMetricsRequest
    EventWindowMetricsResponse:
      properties:
        event_id:
          type: string
          format: uuid
          title: Event Id
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        total_count:
          type: integer
          title: Total Count
        data:
          items:
            $ref: '#/components/schemas/EventMetricPoint'
          type: array
          title: Data
      type: object
      required:
        - event_id
        - total_count
        - data
      title: EventWindowMetricsResponse
    FactCondition:
      properties:
        column:
          type: string
          maxLength: 255
          minLength: 1
          title: Column
        operator:
          type: string
          enum:
            - eq
            - ne
            - gt
            - gte
            - lt
            - lte
            - contains
            - not_contains
            - like
            - not_like
            - in
            - not_in
            - is_null
            - is_not_null
            - is_true
            - is_false
          title: Operator
        value:
          anyOf:
            - type: string
              maxLength: 4096
            - type: integer
            - type: number
            - type: boolean
            - items:
                anyOf:
                  - type: string
                    maxLength: 4096
                  - type: integer
                  - type: number
                  - type: boolean
              type: array
              maxItems: 100
            - type: 'null'
          title: Value
      additionalProperties: false
      type: object
      required:
        - column
        - operator
      title: FactCondition
      description: One visual fact-row condition compiled into an ANDed SQL filter.
    FactMetricCreate:
      properties:
        kind:
          type: string
          const: fact
          title: Kind
          default: fact
        composition:
          $ref: '#/components/schemas/MetricComposition'
          default: single
        interval:
          $ref: '#/components/schemas/ScanInterval'
        replay_chunk_interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        fact_table_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Fact Table Id
        aggregation:
          anyOf:
            - $ref: '#/components/schemas/MetricAggregation'
            - type: 'null'
        measure_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Measure Column
        distinct_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Distinct Column
        row_filter:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Row Filter
        row_filters:
          items:
            type: string
          type: array
          maxItems: 100
          title: Row Filters
        filter_sql:
          anyOf:
            - type: string
              maxLength: 32768
              minLength: 1
            - type: 'null'
          title: Filter Sql
        conditions:
          items:
            $ref: '#/components/schemas/FactCondition'
          type: array
          maxItems: 100
          title: Conditions
        numerator:
          anyOf:
            - $ref: '#/components/schemas/FactOperand'
            - type: 'null'
        denominator:
          anyOf:
            - $ref: '#/components/schemas/FactOperand'
            - type: 'null'
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        display_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Display Name
        description:
          type: string
          title: Description
          default: ''
        color:
          type: string
          pattern: ^#[0-9a-fA-F]{6}$
          title: Color
          default: '#6366f1'
        order:
          anyOf:
            - type: integer
            - type: 'null'
          title: Order
        unit:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Unit
        status:
          $ref: '#/components/schemas/MetricStatus'
          default: draft
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          type: boolean
          title: Reviewed
          default: false
        breakdown_columns:
          items:
            type: string
          type: array
          title: Breakdown Columns
        breakdown_values_limit:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Breakdown Values Limit
        app_version_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: App Version Column
        platform_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Platform Column
        anomaly_detection_enabled:
          type: boolean
          title: Anomaly Detection Enabled
          default: true
      type: object
      required:
        - interval
        - name
        - display_name
      title: FactMetricCreate
    FactMetricDefinition:
      properties:
        kind:
          type: string
          const: fact
          title: Kind
          default: fact
        composition:
          $ref: '#/components/schemas/MetricComposition'
          default: single
        interval:
          $ref: '#/components/schemas/ScanInterval'
        replay_chunk_interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        fact_table_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Fact Table Id
        aggregation:
          anyOf:
            - $ref: '#/components/schemas/MetricAggregation'
            - type: 'null'
        measure_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Measure Column
        distinct_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Distinct Column
        row_filter:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Row Filter
        row_filters:
          items:
            type: string
          type: array
          maxItems: 100
          title: Row Filters
        filter_sql:
          anyOf:
            - type: string
              maxLength: 32768
              minLength: 1
            - type: 'null'
          title: Filter Sql
        conditions:
          items:
            $ref: '#/components/schemas/FactCondition'
          type: array
          maxItems: 100
          title: Conditions
        numerator:
          anyOf:
            - $ref: '#/components/schemas/FactOperand'
            - type: 'null'
        denominator:
          anyOf:
            - $ref: '#/components/schemas/FactOperand'
            - type: 'null'
      type: object
      required:
        - interval
      title: FactMetricDefinition
      description: >-
        Kind + collection config for a ``fact`` metric.


        SINGLE (``composition=single``, the default): one operand given by the

        top-level ``fact_table_id`` + ``aggregation`` + the ``measure_column`` /

        ``distinct_column`` / ``row_filters`` / ``filter_sql`` / ``conditions``

        config fields (the legacy single ``row_filter`` name is still accepted
        and

        folded in).


        RATIO (``composition=ratio``): ``numerator`` / ``denominator`` operands
        (each

        a :class:`FactOperand`); the denominator MAY reference a different fact
        table.

        The numerator operand is mirrored onto the model's ``fact_table_id`` /

        ``aggregation`` columns for catalog display and FK integrity.


        The data source and timestamp column are taken from the referenced fact

        table(s) at collection time; only the collection ``interval`` lives
        here.

        Fact-table existence, project ownership, column membership,
        condition-column

        membership, and row-filter name resolution are checked in the service
        (they

        need the DB).
    FactOperand:
      properties:
        fact_table_id:
          type: string
          format: uuid
          title: Fact Table Id
        aggregation:
          $ref: '#/components/schemas/MetricAggregation'
        measure_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Measure Column
        distinct_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Distinct Column
        row_filter:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Row Filter
        row_filters:
          items:
            type: string
          type: array
          maxItems: 100
          title: Row Filters
        filter_sql:
          anyOf:
            - type: string
              maxLength: 32768
              minLength: 1
            - type: 'null'
          title: Filter Sql
        conditions:
          items:
            $ref: '#/components/schemas/FactCondition'
          type: array
          maxItems: 100
          title: Conditions
      additionalProperties: false
      type: object
      required:
        - fact_table_id
        - aggregation
      title: FactOperand
      description: >-
        One fact-table aggregation operand (a single metric, or one ratio side).


        References a ``FactTable`` by id and aggregates one of its introspected

        columns. ``measure_column`` / ``distinct_column`` reach warehouse SQL

        unparameterised, so they are identifier-validated here; their membership
        in

        the referenced fact table's columns is checked in the service (it needs
        the

        DB).


        Row filtering combines three inputs, ANDed together at collection time:

        ``row_filters`` is a list of NAMES of that fact table's stored row
        filters

        (each resolved to its SQL fragment; membership checked in the service),
        and

        ``filter_sql`` is a free-text boolean WHERE fragment
        (SQL-safety-validated

        here). ``conditions`` is a list of visual column/operator/value
        conditions.

        The legacy single ``row_filter`` name is still accepted on input and
        folded

        into the effective named-filter set; new writes use ``row_filters`` +

        ``filter_sql`` + ``conditions``.
    FactOperandPreviewResponse:
      properties:
        columns:
          items:
            type: string
          type: array
          title: Columns
        row_count:
          type: integer
          title: Row Count
          default: 0
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
      type: object
      title: FactOperandPreviewResponse
      description: >-
        Dry-run outcome for ONE fact operand's compiled row filter.


        The request body is the operand itself (:class:`FactOperand`) — the same

        payload a save sends — so the preview compiles from the identical config
        the

        worker will later read. ``columns`` / ``row_count`` describe the
        filtered

        fact query the operand aggregates (probed with a 1-row cap); expected
        user

        mistakes — an unknown named filter, a filter the warehouse rejects, a
        measure

        column the filtered query does not project — come back with ``error``
        set on

        a 200 (see ``metric_preview_service.preview_fact_operand``), not a 5xx.
    FactTableColumnSchema:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        type:
          type: string
          maxLength: 255
          minLength: 1
          title: Type
        native_type:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Native Type
      type: object
      required:
        - name
        - type
      title: FactTableColumnSchema
      description: An introspected column with UI type plus optional native warehouse type.
    FactTableCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        display_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Display Name
        description:
          type: string
          title: Description
          default: ''
        color:
          type: string
          pattern: ^#[0-9a-fA-F]{6}$
          title: Color
          default: '#6366f1'
        data_source_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Data Source Id
        sql:
          type: string
          minLength: 1
          title: Sql
        timestamp_column:
          type: string
          maxLength: 255
          minLength: 1
          title: Timestamp Column
        columns:
          items:
            $ref: '#/components/schemas/FactTableColumnSchema'
          type: array
          title: Columns
        identifier_columns:
          items:
            type: string
          type: array
          title: Identifier Columns
        row_filters:
          items:
            $ref: '#/components/schemas/FactTableRowFilter'
          type: array
          maxItems: 100
          title: Row Filters
      additionalProperties: false
      type: object
      required:
        - name
        - display_name
        - sql
        - timestamp_column
      title: FactTableCreate
      description: >-
        Create a fact table from a full read-only query plus its column
        metadata.


        ``sql`` must be a single read-only ``SELECT`` or top-level ``WITH ...
        SELECT``

        (validated via the shared SELECT-safety path that rejects stacked
        statements,

        comments, DDL/DML and ``UNION``). ``timestamp_column`` and

        ``identifier_columns`` are validated as bare identifiers since they
        reach

        warehouse SQL unparameterised.
    FactTableListItem:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
        description:
          type: string
          title: Description
        color:
          type: string
          title: Color
        order:
          type: integer
          title: Order
        data_source_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Data Source Id
        timestamp_column:
          type: string
          title: Timestamp Column
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        metric_count:
          type: integer
          title: Metric Count
          default: 0
        column_count:
          type: integer
          title: Column Count
          default: 0
        identifier_count:
          type: integer
          title: Identifier Count
          default: 0
      type: object
      required:
        - id
        - project_id
        - name
        - display_name
        - description
        - color
        - order
        - data_source_id
        - timestamp_column
        - created_at
        - updated_at
      title: FactTableListItem
      description: 'Slim catalog row: presentation + source binding, without the heavy SQL.'
    FactTableListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/FactTableListItem'
          type: array
          title: Items
        total:
          type: integer
          title: Total
      type: object
      required:
        - items
        - total
      title: FactTableListResponse
    FactTablePreviewRequest:
      properties:
        data_source_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Data Source Id
        sql:
          type: string
          minLength: 1
          title: Sql
        timestamp_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Timestamp Column
      additionalProperties: false
      type: object
      required:
        - sql
      title: FactTablePreviewRequest
      description: Introspect a candidate read-only SELECT/CTE before saving a fact table.
    FactTablePreviewResponse:
      properties:
        columns:
          items:
            $ref: '#/components/schemas/FactTableColumnSchema'
          type: array
          title: Columns
        identifier_candidates:
          items:
            type: string
          type: array
          title: Identifier Candidates
      type: object
      required:
        - columns
        - identifier_candidates
      title: FactTablePreviewResponse
    FactTableResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
        description:
          type: string
          title: Description
        color:
          type: string
          title: Color
        order:
          type: integer
          title: Order
        data_source_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Data Source Id
        sql:
          type: string
          title: Sql
        timestamp_column:
          type: string
          title: Timestamp Column
        columns:
          items:
            $ref: '#/components/schemas/FactTableColumnSchema'
          type: array
          title: Columns
        identifier_columns:
          items:
            type: string
          type: array
          title: Identifier Columns
        row_filters:
          items:
            $ref: '#/components/schemas/FactTableRowFilter'
          type: array
          title: Row Filters
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - project_id
        - name
        - display_name
        - description
        - color
        - order
        - data_source_id
        - sql
        - timestamp_column
        - columns
        - identifier_columns
        - row_filters
        - created_at
        - updated_at
      title: FactTableResponse
    FactTableRowFilter:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        sql:
          type: string
          maxLength: 32768
          minLength: 1
          title: Sql
      type: object
      required:
        - name
        - sql
      title: FactTableRowFilter
      description: >-
        A reusable named row filter: a label plus a boolean WHERE fragment.


        The ``sql`` fragment flows into warehouse SQL with no bound parameters,
        so it

        is validated at this boundary via the shared SQL-fragment validator
        (rejects

        comment markers, ``;`` separators, and DDL/DML/``UNION`` keywords).
    FactTableUpdate:
      properties:
        display_name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Display Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        color:
          anyOf:
            - type: string
              pattern: ^#[0-9a-fA-F]{6}$
            - type: 'null'
          title: Color
        order:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Order
        data_source_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Data Source Id
        sql:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Sql
        timestamp_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Timestamp Column
        columns:
          anyOf:
            - items:
                $ref: '#/components/schemas/FactTableColumnSchema'
              type: array
            - type: 'null'
          title: Columns
        identifier_columns:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Identifier Columns
        row_filters:
          anyOf:
            - items:
                $ref: '#/components/schemas/FactTableRowFilter'
              type: array
              maxItems: 100
            - type: 'null'
          title: Row Filters
      additionalProperties: false
      type: object
      title: FactTableUpdate
      description: >-
        Partial update of a fact table.


        ``name`` is immutable (it is the per-project identity) — recreate the
        fact

        table to rename it. Every other field is optional; ``exclude_unset`` at
        the

        service layer keeps only the fields the client actually sent.
    FieldDefinitionBulkCreate:
      properties:
        fields:
          items:
            $ref: '#/components/schemas/FieldDefinitionCreate'
          type: array
          minItems: 1
          title: Fields
      type: object
      required:
        - fields
      title: FieldDefinitionBulkCreate
    FieldDefinitionCreate:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
        display_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Display Name
        field_type:
          $ref: '#/components/schemas/FieldDefinitionType'
        is_required:
          type: boolean
          title: Is Required
          default: false
        enum_options:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Enum Options
        description:
          type: string
          title: Description
          default: ''
        order:
          type: integer
          title: Order
          default: 0
        sensitivity:
          $ref: '#/components/schemas/Sensitivity'
          default: none
        contract_required_max_null_rate:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Contract Required Max Null Rate
        contract_regex:
          anyOf:
            - type: string
              maxLength: 500
              minLength: 1
            - type: 'null'
          title: Contract Regex
        contract_min_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Contract Min Value
        contract_max_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Contract Max Value
        contract_max_bad_rate:
          type: number
          maximum: 1
          minimum: 0
          title: Contract Max Bad Rate
          default: 0
      type: object
      required:
        - name
        - display_name
        - field_type
      title: FieldDefinitionCreate
    FieldDefinitionResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
        field_type:
          $ref: '#/components/schemas/FieldDefinitionType'
        is_required:
          type: boolean
          title: Is Required
        enum_options:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Enum Options
        description:
          type: string
          title: Description
        order:
          type: integer
          title: Order
        sensitivity:
          $ref: '#/components/schemas/Sensitivity'
        contract_required_max_null_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Contract Required Max Null Rate
        contract_regex:
          anyOf:
            - type: string
            - type: 'null'
          title: Contract Regex
        contract_min_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Contract Min Value
        contract_max_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Contract Max Value
        contract_max_bad_rate:
          type: number
          title: Contract Max Bad Rate
      type: object
      required:
        - id
        - event_type_id
        - name
        - display_name
        - field_type
        - is_required
        - enum_options
        - description
        - order
        - sensitivity
        - contract_required_max_null_rate
        - contract_regex
        - contract_min_value
        - contract_max_value
        - contract_max_bad_rate
      title: FieldDefinitionResponse
    FieldDefinitionType:
      type: string
      enum:
        - string
        - number
        - boolean
        - json
        - enum
        - url
      title: FieldDefinitionType
    FieldDefinitionUpdate:
      properties:
        display_name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Display Name
        field_type:
          anyOf:
            - $ref: '#/components/schemas/FieldDefinitionType'
            - type: 'null'
        is_required:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Required
        enum_options:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Enum Options
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        order:
          anyOf:
            - type: integer
            - type: 'null'
          title: Order
        sensitivity:
          anyOf:
            - $ref: '#/components/schemas/Sensitivity'
            - type: 'null'
        contract_required_max_null_rate:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Contract Required Max Null Rate
        contract_regex:
          anyOf:
            - type: string
              maxLength: 500
              minLength: 1
            - type: 'null'
          title: Contract Regex
        contract_min_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Contract Min Value
        contract_max_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Contract Max Value
        contract_max_bad_rate:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Contract Max Bad Rate
      type: object
      title: FieldDefinitionUpdate
    FieldReorder:
      properties:
        field_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Field Ids
      type: object
      required:
        - field_ids
      title: FieldReorder
    ForecastPoint:
      properties:
        bucket:
          type: string
          format: date-time
          title: Bucket
        expected_count:
          type: number
          title: Expected Count
        stddev:
          type: number
          title: Stddev
      type: object
      required:
        - bucket
        - expected_count
        - stddev
      title: ForecastPoint
      description: |-
        One-step-ahead expected value emitted alongside the historical series.

        `bucket` is the timestamp of the bucket *being forecast* (i.e. one
        interval past the last actual point). `expected_count` and `stddev` come
        from the same STL/MSTL decomposition used for anomaly detection.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    HealthComponent:
      properties:
        key:
          type: string
          enum:
            - implemented_seen
            - contract
            - drifts
            - signals
            - freshness
            - documentation
          title: Key
        label:
          type: string
          title: Label
        weight:
          type: integer
          title: Weight
        applies:
          type: boolean
          title: Applies
        excluded_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Excluded Reason
        value:
          anyOf:
            - type: number
            - type: 'null'
          title: Value
        effective_weight:
          anyOf:
            - type: number
            - type: 'null'
          title: Effective Weight
        points:
          anyOf:
            - type: number
            - type: 'null'
          title: Points
        detail:
          type: string
          title: Detail
        counts:
          additionalProperties:
            type: integer
          type: object
          title: Counts
      type: object
      required:
        - key
        - label
        - weight
        - applies
        - detail
      title: HealthComponent
      description: >-
        One of the six parts of an event's score.


        ``weight`` is the fixed weight; ``effective_weight`` is its share in
        percent

        after renormalization over the components that apply (null when
        excluded).

        ``points`` is ``effective_weight * value``; the points of an event sum
        to its

        score up to rounding.
    ImpactChange:
      properties:
        kind:
          type: string
          enum:
            - event
            - event_type
            - field
            - variable
            - metric
            - fact_table
            - alert_rule
            - relation
          title: Kind
        id:
          type: string
          format: uuid
          title: Id
        change:
          type: string
          enum:
            - delete
            - deprecate
            - rename
            - change
          title: Change
      type: object
      required:
        - kind
        - id
        - change
      title: ImpactChange
    ImpactItem:
      properties:
        change:
          $ref: '#/components/schemas/ImpactChange'
        entity:
          $ref: '#/components/schemas/DependencyEntity'
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        affected:
          items:
            $ref: '#/components/schemas/DependencyEdge'
          type: array
          title: Affected
        summary:
          type: string
          title: Summary
      type: object
      required:
        - change
        - entity
        - affected
        - summary
      title: ImpactItem
    ImpactRequest:
      properties:
        changes:
          items:
            $ref: '#/components/schemas/ImpactChange'
          type: array
          maxItems: 200
          minItems: 1
          title: Changes
        depth:
          type: integer
          enum:
            - 1
            - 2
          title: Depth
          default: 1
      type: object
      required:
        - changes
      title: ImpactRequest
    ImpactResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/ImpactItem'
          type: array
          title: Items
      type: object
      required:
        - items
      title: ImpactResponse
    ImplementationTicketResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        branch_id:
          type: string
          format: uuid
          title: Branch Id
        tracker_type:
          type: string
          title: Tracker Type
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
        external_key:
          anyOf:
            - type: string
            - type: 'null'
          title: External Key
        external_url:
          type: string
          title: External Url
        status:
          type: string
          title: Status
        summary:
          type: string
          title: Summary
        event_ids:
          items:
            type: string
          type: array
          title: Event Ids
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        closed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Closed At
      type: object
      required:
        - id
        - project_id
        - branch_id
        - tracker_type
        - external_id
        - external_key
        - external_url
        - status
        - summary
        - event_ids
        - created_at
        - updated_at
        - closed_at
      title: ImplementationTicketResponse
      description: >-
        One tracker ticket opened for a merged plan branch (read-only surface).


        Everything here is written by the merge/poll worker; the API never
        accepts

        a ticket from a client. ``external_url`` is ``""`` when the tracker
        replied

        without an issue key, so the UI must fall back to plain text rather than

        render a link to nowhere.
    IncidentSummaryBody:
      properties:
        sentences:
          items:
            $ref: '#/components/schemas/IncidentSummarySentence'
          type: array
          title: Sentences
        facts:
          items:
            $ref: '#/components/schemas/IncidentSummaryFact'
          type: array
          title: Facts
        cause_known:
          type: boolean
          title: Cause Known
        facts_hash:
          type: string
          title: Facts Hash
        generated_at:
          type: string
          format: date-time
          title: Generated At
      type: object
      required:
        - sentences
        - facts
        - cause_known
        - facts_hash
        - generated_at
      title: IncidentSummaryBody
    IncidentSummaryFact:
      properties:
        id:
          type: integer
          title: Id
        kind:
          type: string
          enum:
            - incident
            - scope
            - attribution
            - release
            - similar
            - note
            - comment
          title: Kind
        text:
          type: string
          title: Text
        href:
          anyOf:
            - type: string
            - type: 'null'
          title: Href
      type: object
      required:
        - id
        - kind
        - text
      title: IncidentSummaryFact
    IncidentSummaryResponse:
      properties:
        correlation_group_id:
          type: string
          format: uuid
          title: Correlation Group Id
        state:
          type: string
          enum:
            - disabled
            - missing
            - stale
            - ready
            - failed
          title: State
        disabled_reason:
          anyOf:
            - type: string
              enum:
                - ai_off
                - demo
            - type: 'null'
          title: Disabled Reason
        current_facts_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Current Facts Hash
        summary:
          anyOf:
            - $ref: '#/components/schemas/IncidentSummaryBody'
            - type: 'null'
      type: object
      required:
        - correlation_group_id
        - state
      title: IncidentSummaryResponse
    IncidentSummarySentence:
      properties:
        text:
          type: string
          title: Text
        role:
          type: string
          enum:
            - what_broke
            - cause
            - release
            - history
            - discussion
          title: Role
        fact_ids:
          items:
            type: integer
          type: array
          title: Fact Ids
        generated:
          type: boolean
          title: Generated
          default: true
      type: object
      required:
        - text
        - role
        - fact_ids
      title: IncidentSummarySentence
    InvitationAcceptRequest:
      properties:
        password:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Password
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
      type: object
      title: InvitationAcceptRequest
      description: >-
        Redeeming an invitation.


        Carries no email: the address comes from the invitation itself, so a
        link

        cannot be turned into an account for someone else. Password strength is
        the

        same policy as registration — enforced here at the schema boundary, so
        an

        invalid password never reaches the service.
    InvitationCreate:
      properties:
        email:
          type: string
          format: email
          title: Email
        role:
          $ref: '#/components/schemas/OrganizationRole'
          default: member
      type: object
      required:
        - email
      title: InvitationCreate
      description: What an owner submits to invite one person.
    InvitationCreatedResponse:
      properties:
        invitation:
          $ref: '#/components/schemas/InvitationResponse'
        accept_path:
          type: string
          title: Accept Path
        expires_at:
          type: string
          format: date-time
          title: Expires At
      type: object
      required:
        - invitation
        - accept_path
        - expires_at
      title: InvitationCreatedResponse
      description: >-
        The mint response — the ONLY place the redeem link ever appears.


        ``accept_path`` is a path, not an absolute URL: the backend does not
        reliably

        know its own public origin (it sits behind a proxy, and the SPA may be
        served

        from a different host), so the client joins it to its own origin rather
        than

        the server guessing wrong and producing an unusable link.
    InvitationPreview:
      properties:
        email:
          type: string
          title: Email
        role:
          $ref: '#/components/schemas/OrganizationRole'
        expires_at:
          type: string
          format: date-time
          title: Expires At
      type: object
      required:
        - email
        - role
        - expires_at
      title: InvitationPreview
      description: >-
        What the redeem screen may show before an account exists.


        Reveals only what the person holding the link already has, so it stays

        unauthenticated. Notably it does NOT confirm whether the instance has
        other

        users or what they are.
    InvitationResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        email:
          type: string
          title: Email
        role:
          $ref: '#/components/schemas/OrganizationRole'
        invited_by_user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Invited By User Id
        expires_at:
          type: string
          format: date-time
          title: Expires At
        created_at:
          type: string
          format: date-time
          title: Created At
        is_expired:
          type: boolean
          title: Is Expired
          description: >-
            Whether this link has aged out.


            Computed rather than stored so it cannot go stale, and surfaced
            because

            expired-but-unused rows are deliberately still listed — an owner
            needs

            to see that a link they sent no longer works.
          readOnly: true
      type: object
      required:
        - id
        - email
        - role
        - invited_by_user_id
        - expires_at
        - created_at
        - is_expired
      title: InvitationResponse
      description: >-
        A pending invitation as shown on the Members screen.


        Carries no token and no digest of one: the raw token is returned exactly

        once, by the create call, and listing invitations must never hand out a
        way

        to redeem them.
    LifecycleFindingListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/LifecycleFindingResponse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
      type: object
      required:
        - items
        - total
      title: LifecycleFindingListResponse
    LifecycleFindingResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        event_id:
          type: string
          format: uuid
          title: Event Id
        event_name:
          type: string
          title: Event Name
        kind:
          type: string
          enum:
            - sunset_overdue
            - successor_silent
          title: Kind
        related_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Related Event Id
        related_event_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Related Event Name
        first_seen_at:
          type: string
          format: date-time
          title: First Seen At
        last_seen_at:
          type: string
          format: date-time
          title: Last Seen At
        resolved_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Resolved At
        volume_24h:
          anyOf:
            - type: integer
            - type: 'null'
          title: Volume 24H
        successor_volume_7d:
          anyOf:
            - type: integer
            - type: 'null'
          title: Successor Volume 7D
      type: object
      required:
        - id
        - event_id
        - event_name
        - kind
        - first_seen_at
        - last_seen_at
      title: LifecycleFindingResponse
      description: >-
        One finding of the daily sunset watch.


        ``event_id`` is the DEPRECATED event (main branch) the finding hangs on;

        ``related_event_id`` is its successor for ``successor_silent`` and null
        for

        ``sunset_overdue``. ``volume_24h`` is set on ``sunset_overdue``,

        ``successor_volume_7d`` on ``successor_silent``. ``resolved_at`` is null

        while the condition still holds.
    LoginRequest:
      properties:
        email:
          type: string
          maxLength: 320
          minLength: 3
          title: Email
        password:
          type: string
          maxLength: 255
          minLength: 8
          title: Password
      type: object
      required:
        - email
        - password
      title: LoginRequest
    MarkReadRequest:
      properties:
        ids:
          items:
            type: string
            format: uuid
          type: array
          maxItems: 500
          title: Ids
        all:
          type: boolean
          title: All
          default: false
      type: object
      title: MarkReadRequest
    MarkReadResponse:
      properties:
        updated:
          type: integer
          title: Updated
        unread:
          type: integer
          title: Unread
      type: object
      required:
        - updated
        - unread
      title: MarkReadResponse
    MergeResolutionChoice:
      type: string
      enum:
        - ours
        - theirs
      title: MergeResolutionChoice
    MetaFieldCreate:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          title: Name
        display_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Display Name
        field_type:
          $ref: '#/components/schemas/MetaFieldType'
        is_required:
          type: boolean
          title: Is Required
          default: false
        allow_multiple:
          type: boolean
          title: Allow Multiple
          default: false
        enum_options:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Enum Options
        default_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Default Value
        link_template:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Link Template
        order:
          type: integer
          title: Order
          default: 0
        sensitivity:
          $ref: '#/components/schemas/Sensitivity'
          default: none
      type: object
      required:
        - name
        - display_name
        - field_type
      title: MetaFieldCreate
    MetaFieldResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
        field_type:
          $ref: '#/components/schemas/MetaFieldType'
        is_required:
          type: boolean
          title: Is Required
        allow_multiple:
          type: boolean
          title: Allow Multiple
          default: false
        enum_options:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Enum Options
        default_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Default Value
        link_template:
          anyOf:
            - type: string
            - type: 'null'
          title: Link Template
        order:
          type: integer
          title: Order
        sensitivity:
          $ref: '#/components/schemas/Sensitivity'
      type: object
      required:
        - id
        - project_id
        - name
        - display_name
        - field_type
        - is_required
        - enum_options
        - default_value
        - link_template
        - order
        - sensitivity
      title: MetaFieldResponse
    MetaFieldType:
      type: string
      enum:
        - string
        - url
        - boolean
        - enum
        - date
      title: MetaFieldType
    MetaFieldUpdate:
      properties:
        display_name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Display Name
        field_type:
          anyOf:
            - $ref: '#/components/schemas/MetaFieldType'
            - type: 'null'
        is_required:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Required
        allow_multiple:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Allow Multiple
        enum_options:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Enum Options
        default_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Default Value
        link_template:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Link Template
        order:
          anyOf:
            - type: integer
            - type: 'null'
          title: Order
        sensitivity:
          anyOf:
            - $ref: '#/components/schemas/Sensitivity'
            - type: 'null'
      type: object
      title: MetaFieldUpdate
    MetaFieldUsageResponse:
      properties:
        value_count:
          type: integer
          title: Value Count
        event_count:
          type: integer
          title: Event Count
      type: object
      required:
        - value_count
        - event_count
      title: MetaFieldUsageResponse
      description: >-
        What deleting a meta field would take with it.


        ``value_count`` is every non-empty stored value (a multi-value field
        holds

        several per event); ``event_count`` is the events holding at least one.
    MetricAggregation:
      type: string
      enum:
        - count
        - sum
        - avg
        - min
        - max
        - count_distinct
      title: MetricAggregation
      description: Aggregation applied by a ``fact`` metric over a FactTable column.
    MetricBreakdownSeries:
      properties:
        breakdown_value:
          type: string
          title: Breakdown Value
        is_other:
          type: boolean
          title: Is Other
          default: false
        total_value:
          type: number
          title: Total Value
        data:
          items:
            $ref: '#/components/schemas/MetricSeriesPoint'
          type: array
          title: Data
      type: object
      required:
        - breakdown_value
        - total_value
        - data
      title: MetricBreakdownSeries
    MetricBreakdownsResponse:
      properties:
        metric_id:
          type: string
          format: uuid
          title: Metric Id
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        columns:
          items:
            type: string
          type: array
          title: Columns
        selected_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Selected Column
        series:
          items:
            $ref: '#/components/schemas/MetricBreakdownSeries'
          type: array
          title: Series
      type: object
      required:
        - metric_id
        - columns
        - series
      title: MetricBreakdownsResponse
    MetricCollectNowResponse:
      properties:
        metric_id:
          type: string
          format: uuid
          title: Metric Id
        status:
          type: string
          const: queued
          title: Status
          default: queued
        window_from:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Window From
        window_to:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Window To
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
        metric_count:
          type: integer
          title: Metric Count
          default: 1
      type: object
      required:
        - metric_id
      title: MetricCollectNowResponse
      description: >-
        202 payload for a manual ``POST /metrics/{id}/collect`` trigger.


        ``window_from`` / ``window_to`` describe the backfilled [from, to)
        window for

        ``fact`` / ``sql`` metrics; they are ``None`` for ``event_composition``

        metrics, which have no interval and recompute from the full event-metric

        series. ``task_id`` is the dispatched Celery task id when the broker
        returns

        one, else ``None``. For a fact metric the task is a shared dependency
        batch:

        the response window describes the clicked metric, while each

        different-interval dependent receives its own bounded window in that
        task.

        ``metric_count`` is how many metrics that batch refreshes (1 for a
        metric

        with no active siblings), so a click can say what it set in motion
        instead of

        silently refreshing a dozen other metrics.
    MetricComposition:
      type: string
      enum:
        - single
        - ratio
        - per_distinct_user
      title: MetricComposition
      description: >-
        How an ``event_composition`` or ``fact`` metric combines its series.


        ``event_composition`` uses ``single`` / ``ratio`` /
        ``per_distinct_user``;

        ``fact`` uses ``single`` (one operand) and ``ratio`` (numerator /
        denominator

        operands, each over a — possibly different — FactTable).
    MetricDefinitionBulkUpdate:
      properties:
        metric_ids:
          items:
            type: string
            format: uuid
          type: array
          minItems: 1
          title: Metric Ids
        status:
          anyOf:
            - $ref: '#/components/schemas/MetricStatus'
            - type: 'null'
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Reviewed
        anomaly_detection_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Anomaly Detection Enabled
      type: object
      required:
        - metric_ids
      title: MetricDefinitionBulkUpdate
    MetricDefinitionDetailResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
        description:
          type: string
          title: Description
        color:
          type: string
          title: Color
        order:
          type: integer
          title: Order
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
        status:
          $ref: '#/components/schemas/MetricStatus'
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          type: boolean
          title: Reviewed
        kind:
          $ref: '#/components/schemas/MetricKind'
        aggregation:
          anyOf:
            - $ref: '#/components/schemas/MetricAggregation'
            - type: 'null'
        composition:
          anyOf:
            - $ref: '#/components/schemas/MetricComposition'
            - type: 'null'
        config:
          additionalProperties: true
          type: object
          title: Config
        fact_table_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Fact Table Id
        breakdown_columns:
          items:
            type: string
          type: array
          title: Breakdown Columns
        breakdown_values_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Breakdown Values Limit
        app_version_column:
          anyOf:
            - type: string
            - type: 'null'
          title: App Version Column
        platform_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Platform Column
        data_source_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Data Source Id
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        replay_chunk_interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        numerator_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Numerator Event Id
        numerator_event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Numerator Event Type Id
        denominator_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Denominator Event Id
        denominator_event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Denominator Event Type Id
        anomaly_detection_enabled:
          type: boolean
          title: Anomaly Detection Enabled
        last_collected_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Collected At
        last_collection_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Collection Status
        last_collection_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Collection Error
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        next_collection_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Next Collection At
        collection_due:
          type: boolean
          title: Collection Due
          default: false
      type: object
      required:
        - id
        - project_id
        - name
        - display_name
        - description
        - color
        - order
        - unit
        - status
        - owner_id
        - reviewed
        - kind
        - aggregation
        - composition
        - config
        - fact_table_id
        - breakdown_columns
        - breakdown_values_limit
        - app_version_column
        - platform_column
        - data_source_id
        - interval
        - replay_chunk_interval
        - numerator_event_id
        - numerator_event_type_id
        - denominator_event_id
        - denominator_event_type_id
        - anomaly_detection_enabled
        - last_collected_at
        - last_collection_status
        - last_collection_error
        - created_at
        - updated_at
      title: MetricDefinitionDetailResponse
      description: Metric detail plus exact read-time scheduler state.
    MetricDefinitionListItem:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
        description:
          type: string
          title: Description
        color:
          type: string
          title: Color
        order:
          type: integer
          title: Order
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
        status:
          $ref: '#/components/schemas/MetricStatus'
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          type: boolean
          title: Reviewed
        kind:
          $ref: '#/components/schemas/MetricKind'
        aggregation:
          anyOf:
            - $ref: '#/components/schemas/MetricAggregation'
            - type: 'null'
        composition:
          anyOf:
            - $ref: '#/components/schemas/MetricComposition'
            - type: 'null'
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        anomaly_detection_enabled:
          type: boolean
          title: Anomaly Detection Enabled
        last_collected_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Collected At
        last_collection_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Collection Status
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        latest_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Latest Value
        latest_bucket:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Latest Bucket
        latest_signal:
          anyOf:
            - $ref: '#/components/schemas/MetricSignalResponse'
            - type: 'null'
        spark:
          items:
            type: number
          type: array
          title: Spark
          default: []
      type: object
      required:
        - id
        - project_id
        - name
        - display_name
        - description
        - color
        - order
        - unit
        - status
        - owner_id
        - reviewed
        - kind
        - aggregation
        - composition
        - interval
        - anomaly_detection_enabled
        - last_collected_at
        - last_collection_status
        - created_at
        - updated_at
      title: MetricDefinitionListItem
      description: >-
        Slim list row: the catalog table fields, without the heavier
        config/refs.
    MetricDefinitionListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/MetricDefinitionListItem'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        active_total:
          type: integer
          title: Active Total
          default: 0
      type: object
      required:
        - items
        - total
      title: MetricDefinitionListResponse
    MetricDefinitionMove:
      properties:
        direction:
          type: string
          enum:
            - up
            - down
          title: Direction
        visible_metric_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Visible Metric Ids
      type: object
      required:
        - direction
      title: MetricDefinitionMove
    MetricDefinitionReorder:
      properties:
        metric_ids:
          items:
            type: string
            format: uuid
          type: array
          minItems: 1
          title: Metric Ids
      type: object
      required:
        - metric_ids
      title: MetricDefinitionReorder
    MetricDefinitionResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
        description:
          type: string
          title: Description
        color:
          type: string
          title: Color
        order:
          type: integer
          title: Order
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
        status:
          $ref: '#/components/schemas/MetricStatus'
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          type: boolean
          title: Reviewed
        kind:
          $ref: '#/components/schemas/MetricKind'
        aggregation:
          anyOf:
            - $ref: '#/components/schemas/MetricAggregation'
            - type: 'null'
        composition:
          anyOf:
            - $ref: '#/components/schemas/MetricComposition'
            - type: 'null'
        config:
          additionalProperties: true
          type: object
          title: Config
        fact_table_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Fact Table Id
        breakdown_columns:
          items:
            type: string
          type: array
          title: Breakdown Columns
        breakdown_values_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Breakdown Values Limit
        app_version_column:
          anyOf:
            - type: string
            - type: 'null'
          title: App Version Column
        platform_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Platform Column
        data_source_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Data Source Id
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        replay_chunk_interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        numerator_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Numerator Event Id
        numerator_event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Numerator Event Type Id
        denominator_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Denominator Event Id
        denominator_event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Denominator Event Type Id
        anomaly_detection_enabled:
          type: boolean
          title: Anomaly Detection Enabled
        last_collected_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Collected At
        last_collection_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Collection Status
        last_collection_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Collection Error
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - project_id
        - name
        - display_name
        - description
        - color
        - order
        - unit
        - status
        - owner_id
        - reviewed
        - kind
        - aggregation
        - composition
        - config
        - fact_table_id
        - breakdown_columns
        - breakdown_values_limit
        - app_version_column
        - platform_column
        - data_source_id
        - interval
        - replay_chunk_interval
        - numerator_event_id
        - numerator_event_type_id
        - denominator_event_id
        - denominator_event_type_id
        - anomaly_detection_enabled
        - last_collected_at
        - last_collection_status
        - last_collection_error
        - created_at
        - updated_at
      title: MetricDefinitionResponse
    MetricDefinitionUpdate:
      properties:
        display_name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Display Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        color:
          anyOf:
            - type: string
              pattern: ^#[0-9a-fA-F]{6}$
            - type: 'null'
          title: Color
        order:
          anyOf:
            - type: integer
            - type: 'null'
          title: Order
        unit:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Unit
        status:
          anyOf:
            - $ref: '#/components/schemas/MetricStatus'
            - type: 'null'
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Reviewed
        breakdown_columns:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Breakdown Columns
        breakdown_values_limit:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Breakdown Values Limit
        app_version_column:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: App Version Column
        platform_column:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Platform Column
        anomaly_detection_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Anomaly Detection Enabled
        definition:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/FactMetricDefinition'
                - $ref: '#/components/schemas/SqlMetricDefinition'
                - $ref: '#/components/schemas/EventCompositionMetricDefinition'
              discriminator:
                propertyName: kind
                mapping:
                  event_composition: '#/components/schemas/EventCompositionMetricDefinition'
                  fact: '#/components/schemas/FactMetricDefinition'
                  sql: '#/components/schemas/SqlMetricDefinition'
            - type: 'null'
          title: Definition
      type: object
      title: MetricDefinitionUpdate
      description: >-
        Partial update of presentation, lifecycle, dimension and monitoring
        fields,

        plus an optional ``definition`` block that re-defines the metric's kind
        +

        collection config.


        The internal ``name`` is the stable query identifier and stays
        IMMUTABLE: it

        has no update field and is ignored if supplied. The optional
        ``definition``

        block mirrors the create discriminated union (minus ``name`` and the
        other

        presentation fields, which keep their own update fields here); when
        present it

        is re-validated EXACTLY like creation and the service overwrites the
        metric's

        ``kind`` / ``config`` / collection binding from it.


        ANY definition change that means something different — not just a
        ``kind``

        change — deletes the metric's previously collected values, breakdowns
        and

        anomalies, because they were produced under the old definition. The

        comparison is on meaning, so resending an unchanged ``definition``
        (which the

        catalog form always does) keeps the history. Such a change is refused
        with

        409 while a collection for the metric is already in flight; retry it
        once the

        run finishes.
    MetricGeneratedSqlQuery:
      properties:
        role:
          type: string
          const: primary
          title: Role
          default: primary
        label:
          type: string
          title: Label
        fact_table_id:
          type: string
          format: uuid
          title: Fact Table Id
        fact_table_name:
          type: string
          title: Fact Table Name
        interval:
          type: string
          title: Interval
        window_from:
          type: string
          format: date-time
          title: Window From
        window_to:
          type: string
          format: date-time
          title: Window To
        metric_ids:
          items:
            type: string
            format: uuid
          type: array
          title: Metric Ids
        sql:
          type: string
          title: Sql
      type: object
      required:
        - label
        - fact_table_id
        - fact_table_name
        - interval
        - window_from
        - window_to
        - metric_ids
        - sql
      title: MetricGeneratedSqlQuery
      description: >-
        One executable primary query from the shared fact-collection batch.


        A batch is grouped by interval and fact table, then optionally split
        into

        bounded replay chunks. ``metric_ids`` names the dependency-group metrics

        whose aggregate specs are folded into this statement. Breakdown scans
        are a

        separate path and are explicitly excluded by the response flag below.
    MetricGeneratedSqlResponse:
      properties:
        queries:
          items:
            $ref: '#/components/schemas/MetricGeneratedSqlQuery'
          type: array
          title: Queries
        breakdown_queries_omitted:
          type: boolean
          title: Breakdown Queries Omitted
          default: true
      type: object
      required:
        - queries
      title: MetricGeneratedSqlResponse
    MetricKind:
      type: string
      enum:
        - sql
        - event_composition
        - fact
      title: MetricKind
      description: How a MetricDefinition produces its per-bucket value.
    MetricPreviewPoint:
      properties:
        bucket:
          type: string
          format: date-time
          title: Bucket
        value:
          type: number
          title: Value
      type: object
      required:
        - bucket
        - value
      title: MetricPreviewPoint
      description: One interval-floored (bucket, value) preview point.
    MetricPreviewRequest:
      properties:
        data_source_id:
          type: string
          format: uuid
          title: Data Source Id
        sql:
          type: string
          minLength: 1
          title: Sql
        time_column:
          type: string
          maxLength: 255
          minLength: 1
          title: Time Column
        value_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Value Column
        interval:
          $ref: '#/components/schemas/ScanInterval'
      type: object
      required:
        - data_source_id
        - sql
        - time_column
        - interval
      title: MetricPreviewRequest
      description: >-
        Stateless dry-run of a ``sql``-kind metric SELECT (nothing is
        persisted).


        SQL semantics (read-only shape, projected columns, identifier validity)
        are

        deliberately NOT validated at this schema boundary: those are expected
        user

        mistakes while drafting a query, and the preview endpoint reports them
        as a

        200 response with ``error`` set (see ``metric_preview_service``) instead
        of

        a 422. Only structural shape (types, lengths, interval enum) is enforced

        here.
    MetricPreviewResponse:
      properties:
        columns:
          items:
            type: string
          type: array
          title: Columns
        points:
          items:
            $ref: '#/components/schemas/MetricPreviewPoint'
          type: array
          title: Points
        point_count:
          type: integer
          title: Point Count
          default: 0
        truncated:
          type: boolean
          title: Truncated
          default: false
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
      type: object
      title: MetricPreviewResponse
      description: >-
        Preview outcome; user-level failures set ``error`` with empty
        ``points``.
    MetricScopeType:
      type: string
      enum:
        - project_total
        - event_type
        - event
        - schema
        - distribution
        - release_regression
        - metric
        - variable_value_drift
        - source_freshness
        - lifecycle
        - property_drift
      title: MetricScopeType
    MetricSeriesPoint:
      properties:
        bucket:
          type: string
          format: date-time
          title: Bucket
        value:
          type: number
          title: Value
        expected_count:
          anyOf:
            - type: number
            - type: 'null'
          title: Expected Count
        stddev:
          anyOf:
            - type: number
            - type: 'null'
          title: Stddev
        is_anomaly:
          type: boolean
          title: Is Anomaly
          default: false
        anomaly_direction:
          anyOf:
            - $ref: '#/components/schemas/AnomalyDirection'
            - type: 'null'
        z_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Z Score
        verdict:
          anyOf:
            - $ref: '#/components/schemas/SignalVerdictInfo'
            - type: 'null'
        planned_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Planned Event Id
      type: object
      required:
        - bucket
        - value
      title: MetricSeriesPoint
      description: >-
        One densified point of a catalog-metric series.


        Mirrors ``EventMetricPoint`` but stores a float ``value``.
        ``expected_count``

        / ``stddev`` / ``z_score`` / ``anomaly_direction`` are only populated
        for

        buckets that carry an anomaly row; the rest leave them ``None``.
    MetricSeriesResponse:
      properties:
        metric_id:
          type: string
          format: uuid
          title: Metric Id
        scope:
          type: string
          title: Scope
          default: metric
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        latest_signal:
          anyOf:
            - $ref: '#/components/schemas/MetricSignalResponse'
            - type: 'null'
        sigma_threshold:
          type: number
          title: Sigma Threshold
        data:
          items:
            $ref: '#/components/schemas/MetricSeriesPoint'
          type: array
          title: Data
        forecast:
          items:
            $ref: '#/components/schemas/ForecastPoint'
          type: array
          title: Forecast
          default: []
      type: object
      required:
        - metric_id
        - sigma_threshold
        - data
      title: MetricSeriesResponse
    MetricSignalResponse:
      properties:
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        state:
          type: string
          title: State
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        bucket:
          type: string
          format: date-time
          title: Bucket
        actual_count:
          type: number
          title: Actual Count
        expected_count:
          type: number
          title: Expected Count
        stddev:
          type: number
          title: Stddev
        z_score:
          type: number
          title: Z Score
        direction:
          $ref: '#/components/schemas/AnomalyDirection'
        relative_effect:
          anyOf:
            - type: number
            - type: 'null'
          title: Relative Effect
        scope_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Scope Name
        incident_child:
          type: boolean
          title: Incident Child
          default: false
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
        detected_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Detected At
        incident_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Incident Id
        incident_status:
          anyOf:
            - $ref: '#/components/schemas/AlertInboxStatus'
            - type: 'null'
        acknowledged_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Acknowledged At
        muted:
          type: boolean
          title: Muted
          default: false
        muted_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Muted Until
        expected:
          type: boolean
          title: Expected
          default: false
        expected_note:
          anyOf:
            - type: string
            - type: 'null'
          title: Expected Note
        hidden:
          type: boolean
          title: Hidden
          default: false
        verdict:
          anyOf:
            - $ref: '#/components/schemas/SignalVerdictInfo'
            - type: 'null'
        incident:
          anyOf:
            - $ref: '#/components/schemas/SignalIncidentBrief'
            - type: 'null'
        anomaly_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Anomaly Id
        attribution:
          anyOf:
            - $ref: '#/components/schemas/SignalAttribution'
            - type: 'null'
        attribution_status:
          type: string
          enum:
            - ready
            - no_breakdown_columns
            - not_computed
          title: Attribution Status
          default: not_computed
        owners:
          items:
            $ref: '#/components/schemas/AlertOwnerRef'
          type: array
          title: Owners
      type: object
      required:
        - scope_type
        - scope_ref
        - state
        - bucket
        - actual_count
        - expected_count
        - stddev
        - z_score
        - direction
      title: MetricSignalResponse
    MetricStatus:
      type: string
      enum:
        - draft
        - active
        - archived
      title: MetricStatus
      description: Simple catalog lifecycle for metrics (no dev-implementation states).
    MetricVersionSeries:
      properties:
        version:
          type: string
          title: Version
        is_other:
          type: boolean
          title: Is Other
          default: false
        is_latest:
          type: boolean
          title: Is Latest
          default: false
        is_active:
          type: boolean
          title: Is Active
          default: false
        total_value:
          type: number
          title: Total Value
        data:
          items:
            $ref: '#/components/schemas/MetricSeriesPoint'
          type: array
          title: Data
      type: object
      required:
        - version
        - total_value
        - data
      title: MetricVersionSeries
    MetricVersionSeriesResponse:
      properties:
        metric_id:
          type: string
          format: uuid
          title: Metric Id
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        app_version_column:
          anyOf:
            - type: string
            - type: 'null'
          title: App Version Column
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        latest_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Latest Version
        versions:
          items:
            $ref: '#/components/schemas/AppVersionInfo'
          type: array
          title: Versions
        series:
          items:
            $ref: '#/components/schemas/MetricVersionSeries'
          type: array
          title: Series
      type: object
      required:
        - metric_id
        - versions
        - series
      title: MetricVersionSeriesResponse
    MonitorDetailResponse:
      properties:
        rule_id:
          type: string
          format: uuid
          title: Rule Id
        rule_name:
          type: string
          title: Rule Name
        destination_id:
          type: string
          format: uuid
          title: Destination Id
        destination_name:
          type: string
          title: Destination Name
        destination_type:
          type: string
          title: Destination Type
        enabled:
          type: boolean
          title: Enabled
        status:
          type: string
          enum:
            - firing
            - warning
            - healthy
          title: Status
        active_scope_count:
          type: integer
          title: Active Scope Count
        firing_scope_count:
          type: integer
          title: Firing Scope Count
        last_anomaly_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Anomaly At
        last_notified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Notified At
        notify_on_spike:
          type: boolean
          title: Notify On Spike
        notify_on_drop:
          type: boolean
          title: Notify On Drop
        min_percent_delta:
          type: number
          title: Min Percent Delta
        min_expected_count:
          type: number
          title: Min Expected Count
        cooldown_minutes:
          type: integer
          title: Cooldown Minutes
        muted:
          type: boolean
          title: Muted
        muted_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Muted Until
        rule_enabled:
          type: boolean
          title: Rule Enabled
        destination_enabled:
          type: boolean
          title: Destination Enabled
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        scan_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Scan Name
        include_project_total:
          type: boolean
          title: Include Project Total
        include_event_types:
          type: boolean
          title: Include Event Types
        include_events:
          type: boolean
          title: Include Events
        include_schema_drifts:
          type: boolean
          title: Include Schema Drifts
        include_distribution_drifts:
          type: boolean
          title: Include Distribution Drifts
        include_variable_value_drifts:
          type: boolean
          title: Include Variable Value Drifts
        include_release_regressions:
          type: boolean
          title: Include Release Regressions
        include_metrics:
          type: boolean
          title: Include Metrics
        include_source_freshness:
          type: boolean
          title: Include Source Freshness
        include_lifecycle:
          type: boolean
          title: Include Lifecycle
        include_property_drifts:
          type: boolean
          title: Include Property Drifts
        total_deliveries:
          type: integer
          title: Total Deliveries
        last_delivery_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Delivery At
        last_delivery_status:
          anyOf:
            - $ref: '#/components/schemas/AlertDeliveryStatus'
            - type: 'null'
        firing_scopes:
          items:
            $ref: '#/components/schemas/MonitorFiringScope'
          type: array
          title: Firing Scopes
        scope_readiness:
          $ref: '#/components/schemas/AlertScopeReadiness'
      type: object
      required:
        - rule_id
        - rule_name
        - destination_id
        - destination_name
        - destination_type
        - enabled
        - status
        - active_scope_count
        - firing_scope_count
        - last_anomaly_at
        - last_notified_at
        - notify_on_spike
        - notify_on_drop
        - min_percent_delta
        - min_expected_count
        - cooldown_minutes
        - muted
        - muted_until
        - rule_enabled
        - destination_enabled
        - scan_config_id
        - scan_name
        - include_project_total
        - include_event_types
        - include_events
        - include_schema_drifts
        - include_distribution_drifts
        - include_variable_value_drifts
        - include_release_regressions
        - include_metrics
        - include_source_freshness
        - include_lifecycle
        - include_property_drifts
        - total_deliveries
        - last_delivery_at
        - last_delivery_status
        - firing_scopes
        - scope_readiness
      title: MonitorDetailResponse
      description: A single monitor with the extra context a drill-in detail view needs.
    MonitorFiringScope:
      properties:
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        scope_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Scope Name
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        direction:
          anyOf:
            - $ref: '#/components/schemas/AnomalyDirection'
            - type: 'null'
        last_anomaly_bucket:
          type: string
          format: date-time
          title: Last Anomaly Bucket
        last_notified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Notified At
      type: object
      required:
        - scan_config_id
        - scope_type
        - scope_ref
        - scope_name
        - event_id
        - direction
        - last_anomaly_bucket
        - last_notified_at
      title: MonitorFiringScope
      description: >-
        One scope of a monitor that is firing now.


        Chosen by the same horizon test as ``firing_scope_count``, so the list
        and

        the count cannot disagree. ``scope_name``, ``event_id`` and
        ``direction``

        come from the item of the delivery that last notified this scope; all
        three

        are null for a scope the rule has not notified (a cooldown or a mute can

        hold the first message back while the state is already open).
    MonitorMuteRequest:
      properties:
        muted_until:
          type: string
          format: date-time
          title: Muted Until
      type: object
      required:
        - muted_until
      title: MonitorMuteRequest
    MonitorSummaryItem:
      properties:
        rule_id:
          type: string
          format: uuid
          title: Rule Id
        rule_name:
          type: string
          title: Rule Name
        destination_id:
          type: string
          format: uuid
          title: Destination Id
        destination_name:
          type: string
          title: Destination Name
        destination_type:
          type: string
          title: Destination Type
        enabled:
          type: boolean
          title: Enabled
        status:
          type: string
          enum:
            - firing
            - warning
            - healthy
          title: Status
        active_scope_count:
          type: integer
          title: Active Scope Count
        firing_scope_count:
          type: integer
          title: Firing Scope Count
        last_anomaly_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Anomaly At
        last_notified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Notified At
        notify_on_spike:
          type: boolean
          title: Notify On Spike
        notify_on_drop:
          type: boolean
          title: Notify On Drop
        min_percent_delta:
          type: number
          title: Min Percent Delta
        min_expected_count:
          type: number
          title: Min Expected Count
        cooldown_minutes:
          type: integer
          title: Cooldown Minutes
        muted:
          type: boolean
          title: Muted
        muted_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Muted Until
      type: object
      required:
        - rule_id
        - rule_name
        - destination_id
        - destination_name
        - destination_type
        - enabled
        - status
        - active_scope_count
        - firing_scope_count
        - last_anomaly_at
        - last_notified_at
        - notify_on_spike
        - notify_on_drop
        - min_percent_delta
        - min_expected_count
        - cooldown_minutes
        - muted
        - muted_until
      title: MonitorSummaryItem
      description: One alert rule rolled up into a single monitor status.
    MonitorsSummaryResponse:
      properties:
        monitors:
          items:
            $ref: '#/components/schemas/MonitorSummaryItem'
          type: array
          title: Monitors
        firing_count:
          type: integer
          title: Firing Count
        warning_count:
          type: integer
          title: Warning Count
        healthy_count:
          type: integer
          title: Healthy Count
        total:
          type: integer
          title: Total
        scope_readiness:
          $ref: '#/components/schemas/AlertScopeReadiness'
      type: object
      required:
        - monitors
        - firing_count
        - warning_count
        - healthy_count
        - total
        - scope_readiness
      title: MonitorsSummaryResponse
    NameLintIssue:
      properties:
        code:
          type: string
          enum:
            - case
            - separator
            - verb_order
            - prefix
          title: Code
        message:
          type: string
          title: Message
        suggestion:
          type: string
          title: Suggestion
      type: object
      required:
        - code
        - message
        - suggestion
      title: NameLintIssue
    NamingConventionOut:
      properties:
        case:
          type: string
          enum:
            - snake
            - camel
            - pascal
            - kebab
            - space
            - mixed
          title: Case
        space_style:
          anyOf:
            - type: string
              enum:
                - title
                - lower
                - sentence
            - type: 'null'
          title: Space Style
        separator:
          anyOf:
            - type: string
            - type: 'null'
          title: Separator
        verb_position:
          type: string
          enum:
            - first
            - last
            - unknown
          title: Verb Position
        prefix:
          anyOf:
            - type: string
            - type: 'null'
          title: Prefix
        confidence:
          type: number
          title: Confidence
        sample_size:
          type: integer
          title: Sample Size
      type: object
      required:
        - case
        - verb_position
        - confidence
        - sample_size
      title: NamingConventionOut
    NotificationActor:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        email:
          type: string
          title: Email
      type: object
      required:
        - id
        - name
        - email
      title: NotificationActor
    NotificationPage:
      properties:
        items:
          items:
            $ref: '#/components/schemas/NotificationResponse'
          type: array
          title: Items
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      type: object
      required:
        - items
        - next_cursor
      title: NotificationPage
    NotificationPrefsResponse:
      properties:
        email_mode:
          type: string
          enum:
            - 'off'
            - instant
            - daily
            - weekly
          title: Email Mode
        mentions_email:
          type: boolean
          title: Mentions Email
        email_available:
          type: boolean
          title: Email Available
      type: object
      required:
        - email_mode
        - mentions_email
        - email_available
      title: NotificationPrefsResponse
    NotificationPrefsUpdate:
      properties:
        email_mode:
          anyOf:
            - type: string
              enum:
                - 'off'
                - instant
                - daily
                - weekly
            - type: 'null'
          title: Email Mode
        mentions_email:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Mentions Email
      type: object
      title: NotificationPrefsUpdate
    NotificationResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        project_slug:
          type: string
          title: Project Slug
        project_name:
          type: string
          title: Project Name
        kind:
          type: string
          enum:
            - comment
            - reply
            - mention
            - open_question
            - signal
            - branch_review_requested
            - branch_approved
            - branch_merged
            - lifecycle
            - property_drift
          title: Kind
        entity_type:
          type: string
          enum:
            - event
            - event_type
            - metric
            - branch
            - doc
          title: Entity Type
        entity_id:
          type: string
          format: uuid
          title: Entity Id
        title:
          type: string
          title: Title
        body:
          type: string
          title: Body
        url:
          type: string
          title: Url
        actor:
          anyOf:
            - $ref: '#/components/schemas/NotificationActor'
            - type: 'null'
        read_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Read At
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - project_id
        - project_slug
        - project_name
        - kind
        - entity_type
        - entity_id
        - title
        - body
        - url
        - actor
        - read_at
        - created_at
      title: NotificationResponse
    NotifyOwnersResponse:
      properties:
        owners:
          items:
            $ref: '#/components/schemas/AlertOwnerNotificationResponse'
          type: array
          title: Owners
      type: object
      title: NotifyOwnersResponse
      description: 'What a manual "Notify owners" did: one row per owner it tried.'
    ObservabilitySettings:
      properties:
        request_id_header:
          type: string
          title: Request Id Header
        log_level:
          type: string
          title: Log Level
        log_json:
          type: boolean
          title: Log Json
        prometheus_metrics_enabled:
          type: boolean
          title: Prometheus Metrics Enabled
        otel_exporter_otlp_endpoint:
          type: string
          title: Otel Exporter Otlp Endpoint
        otel_service_name:
          type: string
          title: Otel Service Name
      type: object
      required:
        - request_id_header
        - log_level
        - log_json
        - prometheus_metrics_enabled
        - otel_exporter_otlp_endpoint
        - otel_service_name
      title: ObservabilitySettings
    ObservabilitySettingsUpdate:
      properties:
        request_id_header:
          anyOf:
            - type: string
              maxLength: 100
              minLength: 1
            - type: 'null'
          title: Request Id Header
        log_level:
          anyOf:
            - type: string
              enum:
                - CRITICAL
                - ERROR
                - WARNING
                - INFO
                - DEBUG
            - type: 'null'
          title: Log Level
        log_json:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Log Json
        prometheus_metrics_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Prometheus Metrics Enabled
        otel_exporter_otlp_endpoint:
          anyOf:
            - type: string
            - type: 'null'
          title: Otel Exporter Otlp Endpoint
        otel_service_name:
          anyOf:
            - type: string
              maxLength: 100
              minLength: 1
            - type: 'null'
          title: Otel Service Name
      type: object
      title: ObservabilitySettingsUpdate
    OrgAiSettings:
      properties:
        ai_enabled:
          type: boolean
          title: Ai Enabled
        ai_base_url:
          type: string
          title: Ai Base Url
        ai_model:
          type: string
          title: Ai Model
        ai_api_key_configured:
          type: boolean
          title: Ai Api Key Configured
        ai_timeout_seconds:
          type: integer
          title: Ai Timeout Seconds
        ai_max_output_tokens:
          type: integer
          title: Ai Max Output Tokens
        describe_system_prompt:
          type: string
          title: Describe System Prompt
        ask_system_prompt:
          type: string
          title: Ask System Prompt
        alert_explanation_system_prompt:
          type: string
          title: Alert Explanation System Prompt
      type: object
      required:
        - ai_enabled
        - ai_base_url
        - ai_model
        - ai_api_key_configured
        - ai_timeout_seconds
        - ai_max_output_tokens
        - describe_system_prompt
        - ask_system_prompt
        - alert_explanation_system_prompt
      title: OrgAiSettings
    OrgAiSettingsUpdate:
      properties:
        ai_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Ai Enabled
        ai_base_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Ai Base Url
        ai_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Ai Model
        ai_api_key:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
          title: Ai Api Key
        ai_timeout_seconds:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Ai Timeout Seconds
        ai_max_output_tokens:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Ai Max Output Tokens
        describe_system_prompt:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Describe System Prompt
        ask_system_prompt:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Ask System Prompt
        alert_explanation_system_prompt:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Alert Explanation System Prompt
      additionalProperties: false
      type: object
      title: OrgAiSettingsUpdate
    OrgCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        slug:
          type: string
          maxLength: 255
          minLength: 1
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          title: Slug
      additionalProperties: false
      type: object
      required:
        - name
        - slug
      title: OrgCreate
      description: A new organization. The slug is permanent (owner decision 6).
    OrgDeleteRequest:
      properties:
        confirm_slug:
          type: string
          maxLength: 255
          minLength: 1
          title: Confirm Slug
      type: object
      required:
        - confirm_slug
      title: OrgDeleteRequest
      description: 'The typed confirmation: the organization''s slug, exactly.'
    OrgEmailSettingsUpdate:
      properties:
        smtp_host:
          anyOf:
            - type: string
            - type: 'null'
          title: Smtp Host
        smtp_port:
          anyOf:
            - type: integer
              maximum: 65535
              minimum: 1
            - type: 'null'
          title: Smtp Port
        smtp_username:
          anyOf:
            - type: string
            - type: 'null'
          title: Smtp Username
        smtp_password:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
          title: Smtp Password
        smtp_security:
          anyOf:
            - type: string
              enum:
                - none
                - starttls
                - implicit_tls
            - type: 'null'
          title: Smtp Security
        smtp_from_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Smtp From Address
      additionalProperties: false
      type: object
      title: OrgEmailSettingsUpdate
    OrgGroupCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        description:
          type: string
          maxLength: 2000
          title: Description
          default: ''
      additionalProperties: false
      type: object
      required:
        - name
      title: OrgGroupCreate
    OrgGroupDetail:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        member_count:
          type: integer
          title: Member Count
        managed_by_scim:
          type: boolean
          title: Managed By Scim
          default: false
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        members:
          items:
            $ref: '#/components/schemas/OrgGroupMemberResponse'
          type: array
          title: Members
      type: object
      required:
        - id
        - name
        - description
        - member_count
        - created_at
        - updated_at
        - members
      title: OrgGroupDetail
      description: One group with its members, by name.
    OrgGroupMemberAdd:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
      additionalProperties: false
      type: object
      required:
        - user_id
      title: OrgGroupMemberAdd
      description: Add one member of the organization to the group.
    OrgGroupMemberResponse:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
        email:
          type: string
          title: Email
        name:
          type: string
          title: Name
        added_at:
          type: string
          format: date-time
          title: Added At
      type: object
      required:
        - user_id
        - email
        - name
        - added_at
      title: OrgGroupMemberResponse
    OrgGroupResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        member_count:
          type: integer
          title: Member Count
        managed_by_scim:
          type: boolean
          title: Managed By Scim
          default: false
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - name
        - description
        - member_count
        - created_at
        - updated_at
      title: OrgGroupResponse
      description: One group, with how many members it has.
    OrgGroupUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
        description:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Description
      additionalProperties: false
      type: object
      title: OrgGroupUpdate
      description: >-
        A rename and/or a new description. Omitted fields are left alone;
        ``null`` is a 422.
    OrgJiraDefaults:
      properties:
        base_url:
          type: string
          title: Base Url
        auth_email:
          type: string
          title: Auth Email
        api_token_configured:
          type: boolean
          title: Api Token Configured
        project_key:
          type: string
          title: Project Key
      type: object
      required:
        - base_url
        - auth_email
        - api_token_configured
        - project_key
      title: OrgJiraDefaults
    OrgJiraDefaultsUpdate:
      properties:
        base_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Base Url
        auth_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Auth Email
        api_token:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
          title: Api Token
        project_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Project Key
      additionalProperties: false
      type: object
      title: OrgJiraDefaultsUpdate
    OrgLimitSettings:
      properties:
        scan_row_limit_default:
          type: integer
          title: Scan Row Limit Default
        metrics_row_limit_default:
          type: integer
          title: Metrics Row Limit Default
      type: object
      required:
        - scan_row_limit_default
        - metrics_row_limit_default
      title: OrgLimitSettings
    OrgLimitSettingsUpdate:
      properties:
        scan_row_limit_default:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Scan Row Limit Default
        metrics_row_limit_default:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Metrics Row Limit Default
      additionalProperties: false
      type: object
      title: OrgLimitSettingsUpdate
    OrgLinearDefaults:
      properties:
        api_key_configured:
          type: boolean
          title: Api Key Configured
        team_id:
          type: string
          title: Team Id
      type: object
      required:
        - api_key_configured
        - team_id
      title: OrgLinearDefaults
    OrgLinearDefaultsUpdate:
      properties:
        api_key:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
          title: Api Key
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
      additionalProperties: false
      type: object
      title: OrgLinearDefaultsUpdate
    OrgMemberRemoved:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
        project_memberships_removed:
          type: integer
          title: Project Memberships Removed
        api_keys_revoked:
          type: integer
          title: Api Keys Revoked
        invitations_revoked:
          type: integer
          title: Invitations Revoked
        group_memberships_removed:
          type: integer
          title: Group Memberships Removed
      type: object
      required:
        - user_id
        - project_memberships_removed
        - api_keys_revoked
        - invitations_revoked
        - group_memberships_removed
      title: OrgMemberRemoved
      description: 'What removing a member took away with the membership (critique #28).'
    OrgMembershipOut:
      properties:
        slug:
          type: string
          title: Slug
        name:
          type: string
          title: Name
        role:
          $ref: '#/components/schemas/OrganizationRole'
        status:
          $ref: '#/components/schemas/OrganizationStatus'
          default: active
      type: object
      required:
        - slug
        - name
        - role
      title: OrgMembershipOut
      description: |-
        One organization the signed-in user belongs to, with their role there.

        ``status`` is ``active`` or ``suspended`` (F20 PR14): a suspended
        organization stays listed so the UI can explain why it is closed.
    OrgResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        slug:
          type: string
          title: Slug
        name:
          type: string
          title: Name
        role:
          $ref: '#/components/schemas/OrganizationRole'
        status:
          $ref: '#/components/schemas/OrganizationStatus'
        is_default:
          type: boolean
          title: Is Default
        default_project_role:
          $ref: '#/components/schemas/ProjectMemberRole'
        created_at:
          type: string
          format: date-time
          title: Created At
        step_in:
          type: boolean
          title: Step In
          default: false
      type: object
      required:
        - id
        - slug
        - name
        - role
        - status
        - is_default
        - default_project_role
        - created_at
      title: OrgResponse
      description: One organization, with the caller's role in it.
    OrgSearchSettings:
      properties:
        search_embeddings_enabled:
          type: boolean
          title: Search Embeddings Enabled
        search_embedding_provider:
          type: string
          title: Search Embedding Provider
        search_embedding_model:
          type: string
          title: Search Embedding Model
        search_embedding_base_url:
          type: string
          title: Search Embedding Base Url
        search_embedding_api_key_configured:
          type: boolean
          title: Search Embedding Api Key Configured
        search_embedding_dimensions:
          type: integer
          title: Search Embedding Dimensions
      type: object
      required:
        - search_embeddings_enabled
        - search_embedding_provider
        - search_embedding_model
        - search_embedding_base_url
        - search_embedding_api_key_configured
        - search_embedding_dimensions
      title: OrgSearchSettings
      description: An organization's semantic-search embeddings (F20 PR10).
    OrgSearchSettingsUpdate:
      properties:
        search_embeddings_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Search Embeddings Enabled
        search_embedding_provider:
          anyOf:
            - type: string
              const: openai
            - type: 'null'
          title: Search Embedding Provider
        search_embedding_model:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
            - type: 'null'
          title: Search Embedding Model
        search_embedding_base_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Search Embedding Base Url
        search_embedding_api_key:
          anyOf:
            - type: string
              maxLength: 4096
            - type: 'null'
          title: Search Embedding Api Key
      additionalProperties: false
      type: object
      title: OrgSearchSettingsUpdate
      description: >-
        Endpoint, provider, model and key are ONE credential group: setting any
        of

        them makes the whole group the organization's, and the operator's key is

        never sent to an organization's endpoint. Saved only after a test
        embedding

        of ``search_embedding_dimensions`` values succeeds (422 otherwise).
    OrgSettingsCeilings:
      properties:
        scan_row_limit_default:
          type: integer
          title: Scan Row Limit Default
        metrics_row_limit_default:
          type: integer
          title: Metrics Row Limit Default
        ai_timeout_seconds:
          type: integer
          title: Ai Timeout Seconds
        ai_max_output_tokens:
          type: integer
          title: Ai Max Output Tokens
        photo_max_size_mb:
          type: integer
          title: Photo Max Size Mb
      type: object
      required:
        - scan_row_limit_default
        - metrics_row_limit_default
        - ai_timeout_seconds
        - ai_max_output_tokens
        - photo_max_size_mb
      title: OrgSettingsCeilings
      description: >-
        The operator's maxima: an organization's value above one is clamped to
        it.
    OrgSettingsResponse:
      properties:
        limits:
          $ref: '#/components/schemas/OrgLimitSettings'
        email:
          $ref: '#/components/schemas/EmailSettings'
        ai:
          $ref: '#/components/schemas/OrgAiSettings'
        search:
          $ref: '#/components/schemas/OrgSearchSettings'
        storage:
          $ref: '#/components/schemas/OrgStorageSettings'
        organization:
          type: string
          title: Organization
        scope:
          type: string
          enum:
            - organization
            - operator
          title: Scope
        operator_fallback:
          type: string
          enum:
            - all
            - none
          title: Operator Fallback
        inherited:
          $ref: '#/components/schemas/OrgSettingsValues'
        ceilings:
          $ref: '#/components/schemas/OrgSettingsCeilings'
        storage_limits:
          $ref: '#/components/schemas/OrgStorageLimits'
        overridden_fields:
          items:
            type: string
          type: array
          title: Overridden Fields
        sources:
          additionalProperties:
            type: string
            enum:
              - env
              - override
              - default
              - org
              - disabled
          type: object
          title: Sources
      type: object
      required:
        - limits
        - email
        - ai
        - search
        - storage
        - organization
        - scope
        - operator_fallback
        - inherited
        - ceilings
        - storage_limits
        - overridden_fields
        - sources
      title: OrgSettingsResponse
    OrgSettingsUpdate:
      properties:
        limits:
          anyOf:
            - $ref: '#/components/schemas/OrgLimitSettingsUpdate'
            - type: 'null'
        email:
          anyOf:
            - $ref: '#/components/schemas/OrgEmailSettingsUpdate'
            - type: 'null'
        ai:
          anyOf:
            - $ref: '#/components/schemas/OrgAiSettingsUpdate'
            - type: 'null'
        search:
          anyOf:
            - $ref: '#/components/schemas/OrgSearchSettingsUpdate'
            - type: 'null'
        storage:
          anyOf:
            - $ref: '#/components/schemas/OrgStorageSettingsUpdate'
            - type: 'null'
      additionalProperties: false
      type: object
      title: OrgSettingsUpdate
    OrgSettingsValues:
      properties:
        limits:
          $ref: '#/components/schemas/OrgLimitSettings'
        email:
          $ref: '#/components/schemas/EmailSettings'
        ai:
          $ref: '#/components/schemas/OrgAiSettings'
        search:
          $ref: '#/components/schemas/OrgSearchSettings'
        storage:
          $ref: '#/components/schemas/OrgStorageSettings'
      type: object
      required:
        - limits
        - email
        - ai
        - search
        - storage
      title: OrgSettingsValues
    OrgStorageLimits:
      properties:
        operator_allowed_mime:
          items:
            type: string
          type: array
          title: Operator Allowed Mime
        local_backend_allowed:
          type: boolean
          title: Local Backend Allowed
      type: object
      required:
        - operator_allowed_mime
        - local_backend_allowed
      title: OrgStorageLimits
      description: What the operator allows an organization's storage (F20 PR11).
    OrgStorageSettings:
      properties:
        photo_storage_backend:
          type: string
          title: Photo Storage Backend
        photo_max_size_mb:
          type: integer
          title: Photo Max Size Mb
        photo_allowed_mime:
          type: string
          title: Photo Allowed Mime
        gcs_photo_bucket:
          type: string
          title: Gcs Photo Bucket
        gcs_photo_credentials_configured:
          type: boolean
          title: Gcs Photo Credentials Configured
        gcs_photo_public:
          type: boolean
          title: Gcs Photo Public
        gcs_photo_signed_url_ttl_seconds:
          type: integer
          title: Gcs Photo Signed Url Ttl Seconds
      type: object
      required:
        - photo_storage_backend
        - photo_max_size_mb
        - photo_allowed_mime
        - gcs_photo_bucket
        - gcs_photo_credentials_configured
        - gcs_photo_public
        - gcs_photo_signed_url_ttl_seconds
      title: OrgStorageSettings
      description: |-
        An organization's photo storage (F20 PR11). No server paths: the local
        directory and the operator's credential file are the operator's alone.
    OrgStorageSettingsUpdate:
      properties:
        photo_storage_backend:
          anyOf:
            - type: string
              enum:
                - local
                - gcs
            - type: 'null'
          title: Photo Storage Backend
        photo_max_size_mb:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Photo Max Size Mb
        photo_allowed_mime:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Photo Allowed Mime
        gcs_photo_bucket:
          anyOf:
            - type: string
              maxLength: 222
            - type: 'null'
          title: Gcs Photo Bucket
        gcs_photo_credentials_json:
          anyOf:
            - type: string
              maxLength: 65536
            - type: 'null'
          title: Gcs Photo Credentials Json
        gcs_photo_public:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Gcs Photo Public
        gcs_photo_signed_url_ttl_seconds:
          anyOf:
            - type: integer
              maximum: 604800
              minimum: 60
            - type: 'null'
          title: Gcs Photo Signed Url Ttl Seconds
      additionalProperties: false
      type: object
      title: OrgStorageSettingsUpdate
      description: >-
        Backend, bucket, credential JSON, public URLs and URL lifetime are ONE

        group: setting any of them makes the organization's photos go to its own

        storage, and the platform's credentials are never used on its bucket.

        ``gcs_photo_credentials_json`` is the service-account key file's
        content:

        stored encrypted, never returned; ``null`` or an empty string clears it.
    OrgTrackerDefaultsResponse:
      properties:
        organization:
          type: string
          title: Organization
        jira:
          $ref: '#/components/schemas/OrgJiraDefaults'
        linear:
          $ref: '#/components/schemas/OrgLinearDefaults'
        sources:
          additionalProperties:
            type: string
            enum:
              - org
              - default
          type: object
          title: Sources
      type: object
      required:
        - organization
        - jira
        - linear
        - sources
      title: OrgTrackerDefaultsResponse
    OrgTrackerDefaultsUpdate:
      properties:
        jira:
          anyOf:
            - $ref: '#/components/schemas/OrgJiraDefaultsUpdate'
            - type: 'null'
        linear:
          anyOf:
            - $ref: '#/components/schemas/OrgLinearDefaultsUpdate'
            - type: 'null'
      additionalProperties: false
      type: object
      title: OrgTrackerDefaultsUpdate
    OrgTransferOwnership:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
      type: object
      required:
        - user_id
      title: OrgTransferOwnership
      description: Hand the organization to another member, who becomes an owner.
    OrgUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
        default_project_role:
          anyOf:
            - $ref: '#/components/schemas/ProjectMemberRole'
            - type: 'null'
      additionalProperties: false
      type: object
      title: OrgUpdate
      description: |-
        A partial update: the name and/or the default project role.

        ``extra="forbid"``: the slug is immutable, so sending one is a 422. At
        least one field must be sent.
    OrganizationRole:
      type: string
      enum:
        - owner
        - admin
        - member
      title: OrganizationRole
      description: >-
        A user's role in one organization (``organization_members.role``).


        The source of truth for organization-level rights (F20 PR4). ``owner``
        and

        ``admin`` administer the organization and are the implicit ``owner`` of

        every project in it; only an ``owner`` can make or unmake another owner.

        ``member`` holds the role of their ``project_members`` row in a project,

        or the organization's ``default_project_role`` where they hold none.
    OrganizationStatus:
      type: string
      enum:
        - active
        - deleting
        - suspended
      title: OrganizationStatus
      description: >-
        Lifecycle of an organization row (``organizations.status``, F20 PR6).


        ``deleting`` is set the moment an owner asks to delete the organization;
        a

        Celery job then purges it. From that moment every read of it answers 404

        (``services.org_resolution``), so nothing new lands in an organization
        that

        is on its way out.


        ``suspended`` is set by a platform admin from the platform console (F20

        PR14). The organization stays listed for its members, with its status,
        but

        every org-scoped request of theirs answers 403 "This organization is

        suspended", and the scheduled worker jobs skip its projects

        (``services.active_org_scope``). Unsuspending restores it untouched.
    OverviewKpiSeriesResponse:
      properties:
        days:
          type: integer
          title: Days
        new_events:
          items:
            type: integer
          type: array
          title: New Events
      type: object
      required:
        - days
        - new_events
      title: OverviewKpiSeriesResponse
      description: >-
        Real daily series behind Overview KPI sparklines.


        Only ``new_events`` (events created per day on the main branch, from

        Event.created_at) has genuine history; other KPIs (active events, open

        signals, review-pending) have no time series until snapshotting is
        added,

        so they are intentionally omitted rather than fabricated. The field was

        named ``active_events`` until it was renamed — it never held
        active-event

        counts, and the Overview sparkline repeated that false claim in its
        label.
    PasswordResetConfirmBody:
      properties:
        token:
          type: string
          maxLength: 512
          minLength: 1
          title: Token
        new_password:
          type: string
          maxLength: 255
          title: New Password
      type: object
      required:
        - token
        - new_password
      title: PasswordResetConfirmBody
    PasswordResetConfirmResponse:
      properties:
        message:
          type: string
          title: Message
      type: object
      required:
        - message
      title: PasswordResetConfirmResponse
    PasswordResetRequestBody:
      properties:
        email:
          type: string
          format: email
          title: Email
      type: object
      required:
        - email
      title: PasswordResetRequestBody
    PasswordResetRequestResponse:
      properties:
        message:
          type: string
          title: Message
        email_configured:
          type: boolean
          title: Email Configured
      type: object
      required:
        - message
        - email_configured
      title: PasswordResetRequestResponse
    PhotoLimitsResponse:
      properties:
        photo_max_size_mb:
          type: integer
          title: Photo Max Size Mb
        photo_allowed_mime:
          items:
            type: string
          type: array
          title: Photo Allowed Mime
      type: object
      required:
        - photo_max_size_mb
        - photo_allowed_mime
      title: PhotoLimitsResponse
      description: >-
        What the upload endpoint will take, for the browser to say so up front.


        ``photo_max_size_mb`` is an owner setting; every signed-in user may read
        it,

        because an editor's upload is what it refuses. Both values are the

        organization's (F20 PR11): its own cap, never above the operator's, and
        its

        allow-list, never wider than the operator's.
    PlanBranchCreate:
      properties:
        name:
          type: string
          maxLength: 255
          title: Name
        description:
          type: string
          title: Description
          default: ''
      type: object
      required:
        - name
      title: PlanBranchCreate
    PlanBranchDetailResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          type: string
          title: Name
        kind:
          $ref: '#/components/schemas/BranchKind'
        status:
          $ref: '#/components/schemas/BranchStatus'
        description:
          type: string
          title: Description
        base_revision_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Base Revision Id
        created_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Created By
        merged_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Merged At
        merged_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Merged By
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        ahead:
          anyOf:
            - type: integer
            - type: 'null'
          title: Ahead
        behind_base:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Behind Base
        reviewers:
          items:
            $ref: '#/components/schemas/BranchReviewerResponse'
          type: array
          title: Reviewers
        approvals:
          items:
            $ref: '#/components/schemas/BranchApprovalResponse'
          type: array
          title: Approvals
      type: object
      required:
        - id
        - project_id
        - name
        - kind
        - status
        - description
        - base_revision_id
        - created_by
        - merged_at
        - merged_by
        - created_at
        - updated_at
        - reviewers
        - approvals
      title: PlanBranchDetailResponse
    PlanBranchDiff:
      properties:
        entries:
          items:
            $ref: '#/components/schemas/PlanDiffEntry'
          type: array
          title: Entries
        summary:
          additionalProperties:
            type: integer
          type: object
          title: Summary
        behind_base:
          type: boolean
          title: Behind Base
        renames:
          items:
            $ref: '#/components/schemas/PlanDiffRename'
          type: array
          title: Renames
      type: object
      required:
        - entries
        - summary
        - behind_base
      title: PlanBranchDiff
    PlanBranchList:
      properties:
        items:
          items:
            $ref: '#/components/schemas/PlanBranchResponse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
      type: object
      required:
        - items
        - total
      title: PlanBranchList
    PlanBranchResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          type: string
          title: Name
        kind:
          $ref: '#/components/schemas/BranchKind'
        status:
          $ref: '#/components/schemas/BranchStatus'
        description:
          type: string
          title: Description
        base_revision_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Base Revision Id
        created_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Created By
        merged_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Merged At
        merged_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Merged By
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        ahead:
          anyOf:
            - type: integer
            - type: 'null'
          title: Ahead
        behind_base:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Behind Base
      type: object
      required:
        - id
        - project_id
        - name
        - kind
        - status
        - description
        - base_revision_id
        - created_by
        - merged_at
        - merged_by
        - created_at
        - updated_at
      title: PlanBranchResponse
    PlanDiff:
      properties:
        revision_id:
          type: string
          format: uuid
          title: Revision Id
        compare_to:
          type: string
          format: uuid
          title: Compare To
        entries:
          items:
            $ref: '#/components/schemas/PlanDiffEntry'
          type: array
          title: Entries
        summary:
          additionalProperties:
            type: integer
          type: object
          title: Summary
      type: object
      required:
        - revision_id
        - compare_to
        - entries
        - summary
      title: PlanDiff
    PlanDiffEntry:
      properties:
        entity_type:
          type: string
          enum:
            - event_type
            - field_definition
            - event
            - variable
            - meta_field
            - relation
          title: Entity Type
        kind:
          type: string
          enum:
            - added
            - removed
            - changed
          title: Kind
        name:
          type: string
          title: Name
        parent:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent
        entity_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Entity Id
        changes:
          items:
            type: string
          type: array
          title: Changes
        field_changes:
          items:
            $ref: '#/components/schemas/PlanFieldChange'
          type: array
          title: Field Changes
        before:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Before
        after:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: After
        warnings:
          items:
            type: string
          type: array
          title: Warnings
        housekeeping:
          anyOf:
            - type: string
            - type: 'null'
          title: Housekeeping
      type: object
      required:
        - entity_type
        - kind
        - name
      title: PlanDiffEntry
    PlanDiffRename:
      properties:
        entity_type:
          type: string
          enum:
            - event_type
            - field_definition
            - event
            - variable
            - meta_field
            - relation
          title: Entity Type
        parent:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent
        removed_name:
          type: string
          title: Removed Name
        added_name:
          type: string
          title: Added Name
      type: object
      required:
        - entity_type
        - removed_name
        - added_name
      title: PlanDiffRename
      description: >-
        One removed entry and one added entry that are really a single renamed
        row.


        The diff keys entities by NAME, so a rename splits into a removal of the
        old

        name and an addition of the new one. The merge does not see it that way:
        it

        pairs the two by ``source_name`` and UPDATEs main's row in place,
        keeping the

        id and everything hanging off it. Stating the pairing here is what stops
        the

        UI having to re-derive it, which it cannot do correctly — the pairing
        also

        depends on main, and the diff the UI holds compares the base with the
        branch.


        ``removed_name`` and ``added_name`` are the two entries' ``name``, and

        ``entity_type`` / ``parent`` are shared by both, so the pair addresses
        its

        halves exactly the way ``BranchRevertRequest`` addresses a change.
    PlanExportCodegenModel:
      properties:
        revision:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Revision
        branch:
          type: string
          title: Branch
        branch_id:
          type: string
          format: uuid
          title: Branch Id
        plan_hash:
          type: string
          title: Plan Hash
        format:
          type: string
          const: codegen_model
          title: Format
          default: codegen_model
        event_types:
          items:
            $ref: '#/components/schemas/CodegenEventType'
          type: array
          title: Event Types
        variables:
          items:
            $ref: '#/components/schemas/CodegenVariable'
          type: array
          title: Variables
      type: object
      required:
        - branch
        - branch_id
        - plan_hash
      title: PlanExportCodegenModel
    PlanExportJsonSchemaBundle:
      properties:
        revision:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Revision
        branch:
          type: string
          title: Branch
        branch_id:
          type: string
          format: uuid
          title: Branch Id
        plan_hash:
          type: string
          title: Plan Hash
        format:
          type: string
          const: jsonschema
          title: Format
          default: jsonschema
        schemas:
          additionalProperties:
            additionalProperties: true
            type: object
          type: object
          title: Schemas
      type: object
      required:
        - branch
        - branch_id
        - plan_hash
      title: PlanExportJsonSchemaBundle
    PlanFieldChange:
      properties:
        field:
          type: string
          title: Field
        before:
          title: Before
        after:
          title: After
        items:
          items:
            $ref: '#/components/schemas/PlanValueChange'
          type: array
          title: Items
      type: object
      required:
        - field
      title: PlanFieldChange
      description: >-
        A single field that changed between the base and branch state.


        ``before``/``after`` carry the raw JSON values (not repr strings) so the
        UI

        can render structured values — arrays, override maps — instead of a
        Python

        ``repr``. Only present on ``changed`` entries.
    PlanRevisionCreate:
      properties:
        summary:
          type: string
          maxLength: 2000
          title: Summary
          default: ''
      type: object
      title: PlanRevisionCreate
    PlanRevisionDetail:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        summary:
          type: string
          title: Summary
        created_at:
          type: string
          format: date-time
          title: Created At
        created_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Created By
        kind:
          $ref: '#/components/schemas/PlanRevisionKind'
          default: snapshot
        branch_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Branch Id
        entity_counts:
          additionalProperties:
            type: integer
          type: object
          title: Entity Counts
        payload:
          additionalProperties: true
          type: object
          title: Payload
      type: object
      required:
        - id
        - project_id
        - summary
        - created_at
        - created_by
        - entity_counts
        - payload
      title: PlanRevisionDetail
    PlanRevisionKind:
      type: string
      enum:
        - snapshot
        - branch_base
        - merge
      title: PlanRevisionKind
      description: >-
        What produced a revision.


        ``snapshot`` is a user-taken one (``POST /plan-revisions``);
        ``branch_base``

        is the merge base captured when a branch opens; ``merge`` is the live
        plan

        right after a branch merged into it. Stored rather than parsed back out
        of

        ``summary``, which is free text a user can also write.
    PlanRevisionList:
      properties:
        items:
          items:
            $ref: '#/components/schemas/PlanRevisionSummary'
          type: array
          title: Items
        total:
          type: integer
          title: Total
      type: object
      required:
        - items
        - total
      title: PlanRevisionList
    PlanRevisionSummary:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        summary:
          type: string
          title: Summary
        created_at:
          type: string
          format: date-time
          title: Created At
        created_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Created By
        kind:
          $ref: '#/components/schemas/PlanRevisionKind'
          default: snapshot
        branch_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Branch Id
        entity_counts:
          additionalProperties:
            type: integer
          type: object
          title: Entity Counts
      type: object
      required:
        - id
        - project_id
        - summary
        - created_at
        - created_by
        - entity_counts
      title: PlanRevisionSummary
      description: List-view of a revision — payload omitted to keep responses small.
    PlanValidationFinding:
      properties:
        code:
          type: string
          enum:
            - unknown_event_type
            - unknown_event
            - deprecated_event
            - unknown_field
            - missing_required_field
            - value_not_allowed
            - dynamic_value
            - too_dynamic
            - wrong_type
            - policy_violation
          title: Code
        severity:
          type: string
          enum:
            - error
            - warning
            - info
          title: Severity
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
        message:
          type: string
          title: Message
        rule:
          anyOf:
            - type: string
            - type: 'null'
          title: Rule
      type: object
      required:
        - code
        - severity
        - message
      title: PlanValidationFinding
    PlanValidationItemIn:
      properties:
        ref:
          anyOf:
            - type: string
              maxLength: 1000
            - type: 'null'
          title: Ref
        event_type:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Event Type
        name:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Name
        fields:
          additionalProperties:
            anyOf:
              - type: string
                maxLength: 2000
              - type: boolean
              - type: integer
              - type: number
              - type: 'null'
          propertyNames:
            maxLength: 255
            minLength: 1
          type: object
          maxProperties: 200
          title: Fields
        properties:
          anyOf:
            - additionalProperties: true
              propertyNames:
                maxLength: 255
                minLength: 1
              type: object
              maxProperties: 200
            - type: 'null'
          title: Properties
        complete:
          type: boolean
          title: Complete
          default: false
      type: object
      title: PlanValidationItemIn
    PlanValidationItemResult:
      properties:
        ref:
          type: string
          title: Ref
        status:
          type: string
          enum:
            - ok
            - warning
            - error
          title: Status
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        identity:
          anyOf:
            - type: string
            - type: 'null'
          title: Identity
        findings:
          items:
            $ref: '#/components/schemas/PlanValidationFinding'
          type: array
          title: Findings
      type: object
      required:
        - ref
        - status
      title: PlanValidationItemResult
    PlanValidationRequest:
      properties:
        items:
          items:
            $ref: '#/components/schemas/PlanValidationItemIn'
          type: array
          maxItems: 5000
          title: Items
        strict:
          type: boolean
          title: Strict
          default: false
      type: object
      required:
        - items
      title: PlanValidationRequest
    PlanValidationResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/PlanValidationItemResult'
          type: array
          title: Items
        summary:
          $ref: '#/components/schemas/PlanValidationSummary'
      type: object
      required:
        - items
        - summary
      title: PlanValidationResponse
    PlanValidationSummary:
      properties:
        ok:
          type: integer
          title: Ok
          default: 0
        warnings:
          type: integer
          title: Warnings
          default: 0
        errors:
          type: integer
          title: Errors
          default: 0
      type: object
      title: PlanValidationSummary
    PlanValueChange:
      properties:
        key:
          type: string
          title: Key
        kind:
          type: string
          enum:
            - added
            - removed
            - changed
          title: Kind
        before:
          title: Before
        after:
          title: After
      type: object
      required:
        - key
        - kind
      title: PlanValueChange
      description: >-
        One member of a collection-valued field that moved.


        ``key`` is the member's natural identifier — the field name behind an
        event

        field value, the tag itself, the event an override targets. ``before``/

        ``after`` carry that member's value with the key stripped out, so a
        reviewer

        reads "currency: USD → EUR" instead of two JSON dumps of the whole

        collection.
    PlannedEventCreate:
      properties:
        label:
          type: string
          maxLength: 200
          minLength: 1
          title: Label
        description:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Description
        starts_at:
          type: string
          format: date-time
          title: Starts At
        ends_at:
          type: string
          format: date-time
          title: Ends At
        direction:
          anyOf:
            - $ref: '#/components/schemas/AnomalyDirection'
            - type: 'null'
        scope_type:
          anyOf:
            - $ref: '#/components/schemas/ChartAnnotationScopeType'
            - type: 'null'
        scope_ref:
          anyOf:
            - type: string
              maxLength: 120
              minLength: 1
            - type: 'null'
          title: Scope Ref
      type: object
      required:
        - label
        - starts_at
        - ends_at
      title: PlannedEventCreate
      description: |-
        A window in which the project expects its numbers to move (F18).

        ``direction`` NULL expects either way. The scope pairs like a chart
        annotation's: both NULL covers every series in the project.
    PlannedEventResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        label:
          type: string
          title: Label
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        starts_at:
          type: string
          format: date-time
          title: Starts At
        ends_at:
          type: string
          format: date-time
          title: Ends At
        direction:
          anyOf:
            - $ref: '#/components/schemas/AnomalyDirection'
            - type: 'null'
        scope_type:
          anyOf:
            - $ref: '#/components/schemas/ChartAnnotationScopeType'
            - type: 'null'
        scope_ref:
          anyOf:
            - type: string
            - type: 'null'
          title: Scope Ref
        source:
          type: string
          title: Source
          default: manual
        created_by_user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Created By User Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        scope_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Scope Name
      type: object
      required:
        - id
        - project_id
        - label
        - description
        - starts_at
        - ends_at
        - direction
        - scope_type
        - scope_ref
        - created_by_user_id
        - created_at
        - updated_at
      title: PlannedEventResponse
    PlannedEventUpdate:
      properties:
        label:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
            - type: 'null'
          title: Label
        description:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Description
        starts_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Starts At
        ends_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ends At
        direction:
          anyOf:
            - $ref: '#/components/schemas/AnomalyDirection'
            - type: 'null'
        scope_type:
          anyOf:
            - $ref: '#/components/schemas/ChartAnnotationScopeType'
            - type: 'null'
        scope_ref:
          anyOf:
            - type: string
              maxLength: 120
              minLength: 1
            - type: 'null'
          title: Scope Ref
      type: object
      title: PlannedEventUpdate
      description: A partial edit; the merged event is validated as a whole by the route.
    PlannedWindowSuggestionResponse:
      properties:
        scope_type:
          $ref: '#/components/schemas/ChartAnnotationScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        scope_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Scope Name
        weekday:
          type: integer
          title: Weekday
        hour:
          type: integer
          title: Hour
        direction:
          anyOf:
            - $ref: '#/components/schemas/AnomalyDirection'
            - type: 'null'
        verdict_count:
          type: integer
          title: Verdict Count
        last_bucket:
          type: string
          format: date-time
          title: Last Bucket
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
        windows:
          items:
            $ref: '#/components/schemas/SuggestedWindowResponse'
          type: array
          title: Windows
      type: object
      required:
        - scope_type
        - scope_ref
        - weekday
        - hour
        - direction
        - verdict_count
        - last_bucket
        - note
        - windows
      title: PlannedWindowSuggestionResponse
      description: >-
        A recurring window people keep marking expected, proposed as planned
        events.
    PlatformParityAnomaly:
      properties:
        bucket:
          type: string
          format: date-time
          title: Bucket
        actual_share:
          type: number
          title: Actual Share
        expected_share:
          type: number
          title: Expected Share
        stddev:
          type: number
          title: Stddev
        z_score:
          type: number
          title: Z Score
        direction:
          $ref: '#/components/schemas/AnomalyDirection'
      type: object
      required:
        - bucket
        - actual_share
        - expected_share
        - stddev
        - z_score
        - direction
      title: PlatformParityAnomaly
    PlatformPresenceResponse:
      properties:
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        platform_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Platform Column
        platforms:
          items:
            type: string
          type: array
          title: Platforms
        items:
          items:
            $ref: '#/components/schemas/PlatformPresenceRow'
          type: array
          title: Items
      type: object
      required:
        - scan_config_id
        - platforms
        - items
      title: PlatformPresenceResponse
      description: >-
        Per-event platform presence matrix derived from EventMetricBreakdown
        rows

        on the scan's designated ``platform_column``. Empty when the column is
        unset.
    PlatformPresenceRow:
      properties:
        event_id:
          type: string
          format: uuid
          title: Event Id
        event_name:
          type: string
          title: Event Name
        present_platforms:
          items:
            type: string
          type: array
          title: Present Platforms
      type: object
      required:
        - event_id
        - event_name
        - present_platforms
      title: PlatformPresenceRow
      description: One event and the platform values it has stored breakdown data for.
    PostgresSettings:
      properties:
        sslmode:
          anyOf:
            - type: string
              enum:
                - disable
                - allow
                - prefer
                - require
                - verify-ca
                - verify-full
            - type: 'null'
          title: Sslmode
        sslrootcert:
          anyOf:
            - type: string
              maxLength: 64000
            - type: 'null'
          title: Sslrootcert
        sslcert:
          anyOf:
            - type: string
              maxLength: 64000
            - type: 'null'
          title: Sslcert
        sslkey:
          anyOf:
            - type: string
              maxLength: 64000
              format: password
              writeOnly: true
            - type: 'null'
          title: Sslkey
        search_path:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Search Path
      additionalProperties: false
      type: object
      title: PostgresSettings
      description: Typed allowlist of safe PostgreSQL connection options.
    ProjectAnomalySettingsResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        anomaly_detection_enabled:
          type: boolean
          title: Anomaly Detection Enabled
        detect_project_total:
          type: boolean
          title: Detect Project Total
        detect_event_types:
          type: boolean
          title: Detect Event Types
        detect_events:
          type: boolean
          title: Detect Events
        detect_metrics:
          type: boolean
          title: Detect Metrics
        baseline_window_buckets:
          type: integer
          title: Baseline Window Buckets
        min_history_buckets:
          type: integer
          title: Min History Buckets
        sigma_threshold:
          type: number
          title: Sigma Threshold
        min_expected_count:
          type: integer
          title: Min Expected Count
        recent_signal_window_hours:
          type: integer
          title: Recent Signal Window Hours
        anomaly_ingestion_settling_minutes:
          type: integer
          title: Anomaly Ingestion Settling Minutes
        holiday_country:
          anyOf:
            - type: string
            - type: 'null'
          title: Holiday Country
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - project_id
        - anomaly_detection_enabled
        - detect_project_total
        - detect_event_types
        - detect_events
        - detect_metrics
        - baseline_window_buckets
        - min_history_buckets
        - sigma_threshold
        - min_expected_count
        - recent_signal_window_hours
        - anomaly_ingestion_settling_minutes
        - created_at
        - updated_at
      title: ProjectAnomalySettingsResponse
    ProjectAnomalySettingsUpdate:
      properties:
        anomaly_detection_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Anomaly Detection Enabled
        detect_project_total:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Detect Project Total
        detect_event_types:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Detect Event Types
        detect_events:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Detect Events
        detect_metrics:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Detect Metrics
        baseline_window_buckets:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Baseline Window Buckets
        min_history_buckets:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Min History Buckets
        sigma_threshold:
          anyOf:
            - type: number
              minimum: 0.1
            - type: 'null'
          title: Sigma Threshold
        min_expected_count:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Min Expected Count
        recent_signal_window_hours:
          anyOf:
            - type: integer
              maximum: 720
              minimum: 1
            - type: 'null'
          title: Recent Signal Window Hours
        anomaly_ingestion_settling_minutes:
          anyOf:
            - type: integer
              maximum: 1440
              minimum: 0
            - type: 'null'
          title: Anomaly Ingestion Settling Minutes
        holiday_country:
          anyOf:
            - type: string
              maxLength: 2
              minLength: 2
            - type: 'null'
          title: Holiday Country
      type: object
      title: ProjectAnomalySettingsUpdate
    ProjectBranchSettingsResponse:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        min_approvals:
          type: integer
          title: Min Approvals
        block_self_approval:
          type: boolean
          title: Block Self Approval
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
      type: object
      required:
        - project_id
        - min_approvals
        - block_self_approval
      title: ProjectBranchSettingsResponse
      description: |-
        ``id``/timestamps are None while the project still rides the defaults —
        the settings row is only materialized on the first PATCH.
    ProjectBranchSettingsUpdate:
      properties:
        min_approvals:
          anyOf:
            - type: integer
              maximum: 100
              minimum: 0
            - type: 'null'
          title: Min Approvals
        block_self_approval:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Block Self Approval
      type: object
      title: ProjectBranchSettingsUpdate
    ProjectCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        slug:
          type: string
          maxLength: 255
          minLength: 1
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          title: Slug
        description:
          type: string
          title: Description
          default: ''
        app_version_keep_releases:
          type: integer
          maximum: 100
          minimum: 1
          title: App Version Keep Releases
          default: 5
        timezone:
          type: string
          maxLength: 64
          title: Timezone
          default: UTC
        template_id:
          anyOf:
            - type: string
              maxLength: 64
              minLength: 1
            - type: 'null'
          title: Template Id
      type: object
      required:
        - name
        - slug
      title: ProjectCreate
    ProjectCreateResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        slug:
          type: string
          title: Slug
        description:
          type: string
          title: Description
        app_version_keep_releases:
          type: integer
          maximum: 100
          minimum: 1
          title: App Version Keep Releases
          default: 5
        timezone:
          type: string
          title: Timezone
          default: UTC
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        summary:
          $ref: '#/components/schemas/ProjectSummary'
        is_demo:
          type: boolean
          title: Is Demo
          default: false
        generation_status:
          $ref: '#/components/schemas/ProjectGenerationStatus'
          default: ready
        generation_stage:
          anyOf:
            - type: string
            - type: 'null'
          title: Generation Stage
        generation_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Generation Error
        demo_recipe_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Demo Recipe Version
        demo_seeded_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Demo Seeded At
        demo_last_tick_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Demo Last Tick At
        created_by_user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Created By User Id
        can_mutate:
          type: boolean
          title: Can Mutate
          default: false
        my_role:
          type: string
          enum:
            - owner
            - editor
            - viewer
          title: My Role
          default: viewer
        template_branch_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Template Branch Id
      type: object
      required:
        - id
        - name
        - slug
        - description
        - created_at
        - updated_at
      title: ProjectCreateResponse
      description: >-
        ``POST /projects``: the project plus the template branch it opened, if
        any.


        ``template_branch_id`` is the draft branch holding a template's starter
        plan

        (F21, GH #274); null when the project was created blank. Only the create

        route returns it, so the shared ``ProjectResponse`` and the cached
        project

        list stay untouched.
    ProjectGenerationStatus:
      type: string
      enum:
        - pending
        - seeding
        - ready
        - failed
      title: ProjectGenerationStatus
      description: >-
        Provisioning lifecycle for generated (demo) projects.


        Ordinary projects are created ``ready`` in a single step. Demo projects
        move

        ``seeding`` -> ``ready`` on success or ``seeding`` -> ``failed`` when

        provisioning raises; non-``ready`` demos are hidden from normal project
        lists

        so a partially built or failed demo never surfaces as a real workspace.
    ProjectHealthResponse:
      properties:
        score:
          anyOf:
            - type: integer
            - type: 'null'
          title: Score
        grade:
          anyOf:
            - type: string
              enum:
                - healthy
                - warning
                - unhealthy
            - type: 'null'
          title: Grade
        scored_events:
          type: integer
          title: Scored Events
        healthy_count:
          type: integer
          title: Healthy Count
        warning_count:
          type: integer
          title: Warning Count
        unhealthy_count:
          type: integer
          title: Unhealthy Count
        component_averages:
          items:
            $ref: '#/components/schemas/ComponentAverage'
          type: array
          title: Component Averages
        worst:
          items:
            $ref: '#/components/schemas/EventHealthBrief'
          type: array
          title: Worst
        trend:
          items:
            $ref: '#/components/schemas/ProjectHealthTrendPoint'
          type: array
          title: Trend
        previous_score:
          anyOf:
            - type: integer
            - type: 'null'
          title: Previous Score
        computed_at:
          type: string
          format: date-time
          title: Computed At
      type: object
      required:
        - scored_events
        - healthy_count
        - warning_count
        - unhealthy_count
        - component_averages
        - worst
        - trend
        - computed_at
      title: ProjectHealthResponse
    ProjectHealthTrendPoint:
      properties:
        day:
          type: string
          format: date
          title: Day
        score:
          anyOf:
            - type: integer
            - type: 'null'
          title: Score
        scored_events:
          type: integer
          title: Scored Events
      type: object
      required:
        - day
        - scored_events
      title: ProjectHealthTrendPoint
    ProjectLatestScanJob:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        scan_name:
          type: string
          title: Scan Name
        status:
          $ref: '#/components/schemas/ScanJobStatus'
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        result_summary:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Result Summary
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - scan_config_id
        - scan_name
        - status
        - started_at
        - completed_at
        - result_summary
        - error_message
        - created_at
      title: ProjectLatestScanJob
    ProjectLatestSignal:
      properties:
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        scan_name:
          type: string
          title: Scan Name
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        scope_name:
          type: string
          title: Scope Name
        state:
          type: string
          title: State
        bucket:
          type: string
          format: date-time
          title: Bucket
        actual_count:
          type: number
          title: Actual Count
        expected_count:
          type: number
          title: Expected Count
        z_score:
          type: number
          title: Z Score
        direction:
          $ref: '#/components/schemas/AnomalyDirection'
      type: object
      required:
        - scan_config_id
        - scan_name
        - scope_type
        - scope_ref
        - scope_name
        - state
        - bucket
        - actual_count
        - expected_count
        - z_score
        - direction
      title: ProjectLatestSignal
    ProjectMemberCreate:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
        role:
          $ref: '#/components/schemas/ProjectMemberRole'
          default: viewer
      type: object
      required:
        - user_id
      title: ProjectMemberCreate
    ProjectMemberResponse:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
        name:
          type: string
          title: Name
        email:
          type: string
          title: Email
        role:
          $ref: '#/components/schemas/ProjectMemberRole'
        added_at:
          type: string
          format: date-time
          title: Added At
      type: object
      required:
        - user_id
        - name
        - email
        - role
        - added_at
      title: ProjectMemberResponse
    ProjectMemberRole:
      type: string
      enum:
        - none
        - editor
        - viewer
      title: ProjectMemberRole
      description: >-
        A user's role inside one project (``project_members.role``).


        There is no per-project ``owner``: an owner or admin of the project's

        organization (:class:`OrganizationRole`) sees and manages every project
        of

        that organization without a membership row, as project role ``owner``.
        For

        everyone else the row is authoritative (``services.project_access``),
        and

        a member without a row gets the organization's ``default_project_role``.


        ``none`` is "no access": as a row it opts one organization member out of

        one project (the project is a 404 for them, whatever the organization

        default); as ``organizations.default_project_role`` it means members see

        only the projects they hold a row in.
    ProjectMemberUpdate:
      properties:
        role:
          $ref: '#/components/schemas/ProjectMemberRole'
      type: object
      required:
        - role
      title: ProjectMemberUpdate
    ProjectResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        slug:
          type: string
          title: Slug
        description:
          type: string
          title: Description
        app_version_keep_releases:
          type: integer
          maximum: 100
          minimum: 1
          title: App Version Keep Releases
          default: 5
        timezone:
          type: string
          title: Timezone
          default: UTC
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        summary:
          $ref: '#/components/schemas/ProjectSummary'
        is_demo:
          type: boolean
          title: Is Demo
          default: false
        generation_status:
          $ref: '#/components/schemas/ProjectGenerationStatus'
          default: ready
        generation_stage:
          anyOf:
            - type: string
            - type: 'null'
          title: Generation Stage
        generation_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Generation Error
        demo_recipe_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Demo Recipe Version
        demo_seeded_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Demo Seeded At
        demo_last_tick_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Demo Last Tick At
        created_by_user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Created By User Id
        can_mutate:
          type: boolean
          title: Can Mutate
          default: false
        my_role:
          type: string
          enum:
            - owner
            - editor
            - viewer
          title: My Role
          default: viewer
      type: object
      required:
        - id
        - name
        - slug
        - description
        - created_at
        - updated_at
      title: ProjectResponse
    ProjectSummary:
      properties:
        event_type_count:
          type: integer
          title: Event Type Count
          default: 0
        event_count:
          type: integer
          title: Event Count
          default: 0
        active_event_count:
          type: integer
          title: Active Event Count
          default: 0
        implemented_event_count:
          type: integer
          title: Implemented Event Count
          default: 0
        review_pending_event_count:
          type: integer
          title: Review Pending Event Count
          default: 0
        archived_event_count:
          type: integer
          title: Archived Event Count
          default: 0
        variable_count:
          type: integer
          title: Variable Count
          default: 0
        scan_count:
          type: integer
          title: Scan Count
          default: 0
        metric_count:
          type: integer
          title: Metric Count
          default: 0
        alert_destination_count:
          type: integer
          title: Alert Destination Count
          default: 0
        alert_rule_count:
          type: integer
          title: Alert Rule Count
          default: 0
        monitoring_signal_count:
          type: integer
          title: Monitoring Signal Count
          default: 0
        open_property_drift_count:
          type: integer
          title: Open Property Drift Count
          default: 0
        firing_monitor_count:
          type: integer
          title: Firing Monitor Count
          default: 0
        open_incident_count:
          type: integer
          title: Open Incident Count
          default: 0
        failing_scan_config_count:
          type: integer
          title: Failing Scan Config Count
          default: 0
        failing_alert_destination_count:
          type: integer
          title: Failing Alert Destination Count
          default: 0
        latest_scan_job:
          anyOf:
            - $ref: '#/components/schemas/ProjectLatestScanJob'
            - type: 'null'
        latest_signal:
          anyOf:
            - $ref: '#/components/schemas/ProjectLatestSignal'
            - type: 'null'
      type: object
      title: ProjectSummary
    ProjectTemplateAlertSuggestionOut:
      properties:
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        needs:
          type: string
          const: alert_destination
          title: Needs
      type: object
      required:
        - name
        - description
        - needs
      title: ProjectTemplateAlertSuggestionOut
    ProjectTemplateCounts:
      properties:
        event_types:
          type: integer
          title: Event Types
        fields:
          type: integer
          title: Fields
        events:
          type: integer
          title: Events
        variables:
          type: integer
          title: Variables
        metric_suggestions:
          type: integer
          title: Metric Suggestions
        alert_suggestions:
          type: integer
          title: Alert Suggestions
      type: object
      required:
        - event_types
        - fields
        - events
        - variables
        - metric_suggestions
        - alert_suggestions
      title: ProjectTemplateCounts
    ProjectTemplateMetricSuggestionOut:
      properties:
        name:
          type: string
          title: Name
        display_name:
          type: string
          title: Display Name
        description:
          type: string
          title: Description
        kind:
          type: string
          enum:
            - event_composition
            - fact
            - sql
          title: Kind
        composition:
          anyOf:
            - type: string
              enum:
                - single
                - ratio
            - type: 'null'
          title: Composition
        numerator_event:
          anyOf:
            - type: string
            - type: 'null'
          title: Numerator Event
        denominator_event:
          anyOf:
            - type: string
            - type: 'null'
          title: Denominator Event
        needs:
          type: string
          enum:
            - scan
            - data_source
          title: Needs
      type: object
      required:
        - name
        - display_name
        - description
        - kind
        - needs
      title: ProjectTemplateMetricSuggestionOut
    ProjectTemplateSummary:
      properties:
        id:
          type: string
          title: Id
        version:
          type: integer
          title: Version
        name:
          type: string
          title: Name
        description:
          type: string
          title: Description
        branch_name:
          type: string
          title: Branch Name
        counts:
          $ref: '#/components/schemas/ProjectTemplateCounts'
        event_type_names:
          items:
            type: string
          type: array
          title: Event Type Names
        metric_suggestions:
          items:
            $ref: '#/components/schemas/ProjectTemplateMetricSuggestionOut'
          type: array
          title: Metric Suggestions
        alert_suggestions:
          items:
            $ref: '#/components/schemas/ProjectTemplateAlertSuggestionOut'
          type: array
          title: Alert Suggestions
      type: object
      required:
        - id
        - version
        - name
        - description
        - branch_name
        - counts
        - event_type_names
        - metric_suggestions
        - alert_suggestions
      title: ProjectTemplateSummary
    ProjectTrackerConfigResponse:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        enabled:
          type: boolean
          title: Enabled
        tracker_type:
          type: string
          title: Tracker Type
        base_url:
          type: string
          title: Base Url
        project_key:
          type: string
          title: Project Key
        auth_email:
          type: string
          title: Auth Email
        issue_type:
          type: string
          title: Issue Type
        team_id:
          type: string
          title: Team Id
          default: ''
        api_token_set:
          type: boolean
          title: Api Token Set
        inherited_fields:
          items:
            type: string
          type: array
          title: Inherited Fields
          default: []
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
      type: object
      required:
        - project_id
        - enabled
        - tracker_type
        - base_url
        - project_key
        - auth_email
        - issue_type
        - api_token_set
      title: ProjectTrackerConfigResponse
      description: >-
        ``id``/timestamps are None while the project rides the defaults — the
        row

        is only materialized on the first PATCH. The token is never returned;
        only

        ``api_token_set`` signals whether one is stored.
    ProjectTrackerConfigUpdate:
      properties:
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
        tracker_type:
          anyOf:
            - type: string
              enum:
                - jira
                - linear
            - type: 'null'
          title: Tracker Type
        base_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Base Url
        project_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Project Key
        auth_email:
          anyOf:
            - type: string
            - type: 'null'
          title: Auth Email
        api_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Token
        issue_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Issue Type
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
      type: object
      title: ProjectTrackerConfigUpdate
      description: >-
        Partial update — every field optional. ``api_token`` is the RAW token on

        input; it is encrypted at rest and never echoed back. Passing ``""``
        clears

        the stored token; omitting / null leaves it unchanged.


        ``tracker_type`` picks the backend. For ``jira`` the credential is the
        Jira

        API token and ``base_url`` / ``auth_email`` / ``project_key`` /

        ``issue_type`` apply. For ``linear`` ``api_token`` carries the Linear
        API

        key (same encryption, same never-echoed rule) and ``team_id`` the Linear

        team; the Jira-only fields are ignored. Switching ``tracker_type``
        clears

        the stored credential unless the same request supplies a new one, so one

        vendor's secret is never sent to the other.
    ProjectUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
        slug:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
              pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
            - type: 'null'
          title: Slug
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        app_version_keep_releases:
          type: integer
          maximum: 100
          minimum: 1
          title: App Version Keep Releases
        timezone:
          type: string
          maxLength: 64
          title: Timezone
      type: object
      title: ProjectUpdate
    PropertyDriftActionRequest:
      properties:
        action:
          type: string
          enum:
            - accept
            - snooze
            - false_positive
            - reopen
          title: Action
        note:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Note
        snoozed_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Snoozed Until
      type: object
      required:
        - action
      title: PropertyDriftActionRequest
      description: |-
        Triage one property drift.

        ``accept`` changes the plan to match what the scan saw: a new property
        joins the event's property list, a missing one stops being required, and
        a type change retypes the variable to the observed type.
    PropertyDriftKind:
      type: string
      enum:
        - new_property
        - missing_required
        - type_change
      title: PropertyDriftKind
    PropertyDriftListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/PropertyDriftResponse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
      type: object
      required:
        - items
        - total
      title: PropertyDriftListResponse
    PropertyDriftResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        variable_id:
          type: string
          format: uuid
          title: Variable Id
        variable_name:
          type: string
          title: Variable Name
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        event_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Name
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        kind:
          $ref: '#/components/schemas/PropertyDriftKind'
        detail:
          additionalProperties: true
          type: object
          title: Detail
          description: >-
            What the scan saw: presence_rate (and threshold) for new_property
            and missing_required; expected_type, observed_type and
            observed_schema for type_change. For an object property whose
            sampled objects disagree with its sub-schema, type_change also
            carries nested_changes (each a path, a change of new_key,
            missing_required or type_change, and for a type change the expected
            and observed types), and observed_schema is the stored sub-schema
            with those changes applied.
          default: {}
        status:
          $ref: '#/components/schemas/SchemaDriftStatus'
          default: open
        resolution_note:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolution Note
        snoozed_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Snoozed Until
        resolved_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Resolved At
        resolved_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Resolved By
        detected_at:
          type: string
          format: date-time
          title: Detected At
      type: object
      required:
        - id
        - variable_id
        - variable_name
        - kind
        - detected_at
      title: PropertyDriftResponse
    PropertyEventResponse:
      properties:
        event_id:
          type: string
          format: uuid
          title: Event Id
        event_name:
          type: string
          title: Event Name
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        status:
          type: string
          title: Status
        required:
          type: boolean
          title: Required
          default: false
        values:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Values
          description: >-
            This event's override of the allowed values; null when there is
            none.
        effective_values:
          items:
            type: string
          type: array
          title: Effective Values
          description: >-
            The allowed values in force for this event: the override when there
            is one, else the property's global list.
          default: []
        presence_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Presence Rate
          description: >-
            Share of the event's rows that carried the property at the last
            scan.
        required_presence_threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Required Presence Threshold
          description: The event's own threshold; null means the default (0.95).
        suggested_required:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Suggested Required
          description: >-
            Whether presence_rate reaches the event's threshold; null when
            presence is unknown.
      type: object
      required:
        - event_id
        - event_name
        - event_type_id
        - status
      title: PropertyEventResponse
      description: One event whose property list carries the property, with its entry.
    PropertyEventsBulkDelete:
      properties:
        event_ids:
          items:
            type: string
            format: uuid
          type: array
          maxItems: 5000
          minItems: 1
          title: Event Ids
      type: object
      required:
        - event_ids
      title: PropertyEventsBulkDelete
      description: Take the property off many events' lists (their overrides go with it).
    PropertyEventsBulkResult:
      properties:
        created:
          type: integer
          title: Created
          description: Events the property was added to.
        updated:
          type: integer
          title: Updated
          description: Events whose existing entry was edited.
        removed:
          type: integer
          title: Removed
          description: Events the property was taken off.
          default: 0
      type: object
      required:
        - created
        - updated
      title: PropertyEventsBulkResult
    PropertyEventsBulkUpsert:
      properties:
        event_ids:
          items:
            type: string
            format: uuid
          type: array
          maxItems: 5000
          minItems: 1
          title: Event Ids
        required:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Required
          description: Whether every occurrence of each event must carry the property.
        values:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 500
            - type: 'null'
          title: Values
          description: >-
            Allowed values for these events, replacing the property's global
            list. null: no override, the global list applies.
      type: object
      required:
        - event_ids
      title: PropertyEventsBulkUpsert
      description: >-
        Add the property to many events' lists, or edit its entry on each.


        The same patch as the single ``PUT .../event-overrides/{event_id}``: a
        field

        left out keeps what each entry holds, a new entry starts with no
        override

        and not required, and ``values: null`` drops the override.
    RegisterRequest:
      properties:
        email:
          type: string
          format: email
          title: Email
        password:
          type: string
          maxLength: 255
          title: Password
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
        org_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Name
        org_slug:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Slug
      type: object
      required:
        - email
        - password
      title: RegisterRequest
    RelationCreate:
      properties:
        source_event_type_id:
          type: string
          format: uuid
          title: Source Event Type Id
        target_event_type_id:
          type: string
          format: uuid
          title: Target Event Type Id
        source_field_id:
          type: string
          format: uuid
          title: Source Field Id
        target_field_id:
          type: string
          format: uuid
          title: Target Field Id
        relation_type:
          type: string
          maxLength: 50
          title: Relation Type
          default: belongs_to
        description:
          type: string
          title: Description
          default: ''
      type: object
      required:
        - source_event_type_id
        - target_event_type_id
        - source_field_id
        - target_field_id
      title: RelationCreate
    RelationResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        source_event_type_id:
          type: string
          format: uuid
          title: Source Event Type Id
        target_event_type_id:
          type: string
          format: uuid
          title: Target Event Type Id
        source_field_id:
          type: string
          format: uuid
          title: Source Field Id
        target_field_id:
          type: string
          format: uuid
          title: Target Field Id
        relation_type:
          type: string
          title: Relation Type
        description:
          type: string
          title: Description
      type: object
      required:
        - id
        - project_id
        - source_event_type_id
        - target_event_type_id
        - source_field_id
        - target_field_id
        - relation_type
        - description
      title: RelationResponse
    RelationUpdate:
      properties:
        source_event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Source Event Type Id
        target_event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Target Event Type Id
        source_field_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Source Field Id
        target_field_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Target Field Id
        relation_type:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Relation Type
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      title: RelationUpdate
      description: >-
        Editing a relation in place; every field optional, none nullable.


        An end is re-checked against the project branch whenever either of its
        ids

        changes, with the stored id standing in for the one not sent.
    ReleaseComparabilityItem:
      properties:
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        comparable:
          type: boolean
          title: Comparable
        reason:
          $ref: '#/components/schemas/ReleaseComparabilityReason'
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
        previous_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Previous Version
        emerging_share:
          type: number
          title: Emerging Share
        max_emerging_share:
          type: number
          title: Max Emerging Share
      type: object
      required:
        - scope_type
        - comparable
        - reason
        - emerging_share
        - max_emerging_share
      title: ReleaseComparabilityItem
      description: >-
        Whether one detection pass could judge the latest release at all.


        Served alongside ``items`` because an empty list means two different
        things.

        A caller that only reads ``items`` cannot tell a healthy release from
        one

        whose findings were withheld, and both were served as an empty list
        until

        this was carried through.
    ReleaseComparabilityReason:
      type: string
      enum:
        - comparable
        - no_baseline
        - baseline_no_volume
        - population_mismatch
      title: ReleaseComparabilityReason
      description: >-
        Why one release-regression pass concluded what it concluded.


        Mirrors the ``REASON_*`` constants in

        ``tripl.core.analyzers.release_regression``, which is DB-free and so
        cannot

        import this; keep the two in step.
    ReleaseRegressionItem:
      properties:
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        scope_name:
          type: string
          title: Scope Name
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        kind:
          $ref: '#/components/schemas/ReleaseRegressionKind'
        version:
          type: string
          title: Version
        previous_version:
          type: string
          title: Previous Version
        observed_count:
          type: integer
          title: Observed Count
        expected_count:
          type: number
          title: Expected Count
        ratio:
          type: number
          title: Ratio
        share_prev:
          type: number
          title: Share Prev
        share_new:
          type: number
          title: Share New
        release_share:
          type: number
          title: Release Share
        window_from:
          type: string
          format: date-time
          title: Window From
        window_to:
          type: string
          format: date-time
          title: Window To
      type: object
      required:
        - scope_type
        - scope_ref
        - scope_name
        - kind
        - version
        - previous_version
        - observed_count
        - expected_count
        - ratio
        - share_prev
        - share_new
        - release_share
        - window_from
        - window_to
      title: ReleaseRegressionItem
      description: One event (or event type) that regressed in the latest active release.
    ReleaseRegressionKind:
      type: string
      enum:
        - missing
        - volume_drop
      title: ReleaseRegressionKind
    ReleaseRegressionsResponse:
      properties:
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        app_version_column:
          anyOf:
            - type: string
            - type: 'null'
          title: App Version Column
        latest_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Latest Version
        comparability:
          items:
            $ref: '#/components/schemas/ReleaseComparabilityItem'
          type: array
          title: Comparability
        items:
          items:
            $ref: '#/components/schemas/ReleaseRegressionItem'
          type: array
          title: Items
      type: object
      required:
        - scan_config_id
        - comparability
        - items
      title: ReleaseRegressionsResponse
    ResolutionCreate:
      properties:
        entity_type:
          type: string
          enum:
            - event_type
            - field_definition
            - event
            - variable
            - meta_field
            - relation
          title: Entity Type
        entity_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Entity Name
        field_name:
          type: string
          maxLength: 80
          minLength: 1
          title: Field Name
        choice:
          $ref: '#/components/schemas/MergeResolutionChoice'
      type: object
      required:
        - entity_type
        - entity_name
        - field_name
        - choice
      title: ResolutionCreate
    ResolutionResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        branch_id:
          type: string
          format: uuid
          title: Branch Id
        entity_type:
          type: string
          title: Entity Type
        entity_name:
          type: string
          title: Entity Name
        field_name:
          type: string
          title: Field Name
        choice:
          $ref: '#/components/schemas/MergeResolutionChoice'
        resolved_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Resolved By
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - branch_id
        - entity_type
        - entity_name
        - field_name
        - choice
        - resolved_by
        - created_at
      title: ResolutionResponse
    RowLimitDefaultsResponse:
      properties:
        scan_row_limit_default:
          type: integer
          title: Scan Row Limit Default
        metrics_row_limit_default:
          type: integer
          title: Metrics Row Limit Default
      type: object
      required:
        - scan_row_limit_default
        - metrics_row_limit_default
      title: RowLimitDefaultsResponse
      description: >-
        The instance's effective row caps for a scan with no limit of its own.


        Readable by every signed-in user, unlike the rest of ``/settings``: the
        scan

        form's Limits hints quote them to whoever is filling it in.
    RuntimeSettings:
      properties:
        app_base_url:
          type: string
          title: App Base Url
        scan_row_limit_default:
          type: integer
          title: Scan Row Limit Default
        metrics_row_limit_default:
          type: integer
          title: Metrics Row Limit Default
      type: object
      required:
        - app_base_url
        - scan_row_limit_default
        - metrics_row_limit_default
      title: RuntimeSettings
    RuntimeSettingsUpdate:
      properties:
        app_base_url:
          anyOf:
            - type: string
            - type: 'null'
          title: App Base Url
        scan_row_limit_default:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Scan Row Limit Default
        metrics_row_limit_default:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Metrics Row Limit Default
      type: object
      title: RuntimeSettingsUpdate
    ScanActivityItem:
      properties:
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        latest_job:
          anyOf:
            - $ref: '#/components/schemas/ScanJobResponse'
            - type: 'null'
        failing_streak:
          type: integer
          title: Failing Streak
        rows_read_24h:
          type: integer
          title: Rows Read 24H
        warehouse_rows_24h:
          type: integer
          title: Warehouse Rows 24H
          default: 0
        catalog_combinations_24h:
          type: integer
          title: Catalog Combinations 24H
          default: 0
      type: object
      required:
        - scan_config_id
        - latest_job
        - failing_streak
        - rows_read_24h
      title: ScanActivityItem
      description: One scan config's run activity, as the Scans list shows it.
    ScanActivityResponse:
      properties:
        window_from:
          type: string
          format: date-time
          title: Window From
        window_to:
          type: string
          format: date-time
          title: Window To
        items:
          items:
            $ref: '#/components/schemas/ScanActivityItem'
          type: array
          title: Items
      type: object
      required:
        - window_from
        - window_to
        - items
      title: ScanActivityResponse
      description: Per-scan activity for a project, aggregated in SQL.
    ScanConfigCreate:
      properties:
        data_source_id:
          type: string
          format: uuid
          title: Data Source Id
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        base_query:
          type: string
          minLength: 1
          title: Base Query
        event_type_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Type Column
        time_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Time Column
        event_name_format:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Event Name Format
        json_value_paths:
          items:
            type: string
          type: array
          title: Json Value Paths
        event_group_rules:
          items:
            $ref: '#/components/schemas/EventGroupRule'
          type: array
          title: Event Group Rules
        setup_preset:
          type: string
          enum:
            - custom
            - event_properties
          title: Setup Preset
          default: custom
        event_name_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Event Name Column
        properties_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Properties Column
        json_string_columns:
          items:
            type: string
          type: array
          title: Json String Columns
        metric_breakdown_columns:
          items:
            type: string
          type: array
          title: Metric Breakdown Columns
        metric_breakdown_values_limit:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Metric Breakdown Values Limit
        distribution_drift_fields:
          items:
            type: string
          type: array
          title: Distribution Drift Fields
        cardinality_threshold:
          type: integer
          minimum: 1
          title: Cardinality Threshold
          default: 100
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        replay_chunk_interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        scan_lookback_hours:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Scan Lookback Hours
        scan_row_limit:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Scan Row Limit
        metrics_row_limit:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Metrics Row Limit
        app_version_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: App Version Column
        app_version_keep_releases:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: App Version Keep Releases
          description: >-
            Deprecated compatibility mirror of
            Project.app_version_keep_releases; caller values are ignored.
          deprecated: true
        app_version_prerelease_pattern:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: App Version Prerelease Pattern
        app_version_active_share_min:
          anyOf:
            - type: number
              exclusiveMaximum: 1
              exclusiveMinimum: 0
            - type: 'null'
          title: App Version Active Share Min
        platform_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Platform Column
      type: object
      required:
        - data_source_id
        - name
        - base_query
      title: ScanConfigCreate
    ScanConfigDetailResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        data_source_id:
          type: string
          format: uuid
          title: Data Source Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        name:
          type: string
          title: Name
        base_query:
          type: string
          title: Base Query
        event_type_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Type Column
        time_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Time Column
        event_name_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Name Format
        json_value_paths:
          items:
            type: string
          type: array
          title: Json Value Paths
        event_group_rules:
          items:
            $ref: '#/components/schemas/EventGroupRule'
          type: array
          title: Event Group Rules
        setup_preset:
          type: string
          enum:
            - custom
            - event_properties
          title: Setup Preset
          default: custom
        event_name_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Name Column
        properties_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Properties Column
        json_string_columns:
          items:
            type: string
          type: array
          title: Json String Columns
        metric_breakdown_columns:
          items:
            type: string
          type: array
          title: Metric Breakdown Columns
        metric_breakdown_values_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Metric Breakdown Values Limit
        distribution_drift_fields:
          items:
            type: string
          type: array
          title: Distribution Drift Fields
        cardinality_threshold:
          type: integer
          title: Cardinality Threshold
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        replay_chunk_interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        scan_lookback_hours:
          anyOf:
            - type: integer
            - type: 'null'
          title: Scan Lookback Hours
        scan_row_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Scan Row Limit
        metrics_row_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Metrics Row Limit
        app_version_column:
          anyOf:
            - type: string
            - type: 'null'
          title: App Version Column
        app_version_keep_releases:
          anyOf:
            - type: integer
            - type: 'null'
          title: App Version Keep Releases
          description: >-
            Deprecated compatibility mirror of
            Project.app_version_keep_releases.
          deprecated: true
        app_version_prerelease_pattern:
          anyOf:
            - type: string
            - type: 'null'
          title: App Version Prerelease Pattern
        app_version_active_share_min:
          anyOf:
            - type: number
            - type: 'null'
          title: App Version Active Share Min
        platform_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Platform Column
        last_event_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Event At
        last_collection_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Collection At
        freshness:
          $ref: '#/components/schemas/SourceFreshness'
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        last_metrics_run_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Metrics Run At
        next_metrics_run_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Next Metrics Run At
        monitoring_enabled:
          type: boolean
          title: Monitoring Enabled
          description: >-
            Whether the scheduler collects metrics for this scan.


            Derived, never stored: the beat schedule and every monitoring read
            path

            select on ``interval IS NOT NULL``, so this is that test said out
            loud

            rather than a second switch that could disagree with it.
          readOnly: true
      type: object
      required:
        - id
        - data_source_id
        - project_id
        - event_type_id
        - name
        - base_query
        - event_type_column
        - time_column
        - event_name_format
        - json_value_paths
        - event_group_rules
        - metric_breakdown_columns
        - metric_breakdown_values_limit
        - distribution_drift_fields
        - cardinality_threshold
        - interval
        - replay_chunk_interval
        - scan_lookback_hours
        - scan_row_limit
        - metrics_row_limit
        - app_version_column
        - app_version_keep_releases
        - app_version_prerelease_pattern
        - app_version_active_share_min
        - platform_column
        - freshness
        - created_at
        - updated_at
        - monitoring_enabled
      title: ScanConfigDetailResponse
      description: >-
        One scan config with its metrics schedule.


        Only ``GET /scans/{id}`` computes these, so they are not on the list
        rows.

        ``last_metrics_run_at`` is when the newest scheduled metrics collection

        finished; ``next_metrics_run_at`` the earliest moment the scheduler

        considers the config due again (``now`` when it is due already). Both
        are

        null for a scan the scheduler never collects (no interval or no time

        column), and ``last_metrics_run_at`` also before its first collection.
    ScanConfigPreviewRequest:
      properties:
        data_source_id:
          type: string
          format: uuid
          title: Data Source Id
        base_query:
          type: string
          minLength: 1
          title: Base Query
        limit:
          type: integer
          maximum: 50
          minimum: 1
          title: Limit
          default: 10
        json_value_paths:
          items:
            type: string
          type: array
          title: Json Value Paths
        time_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Time Column
        scan_lookback_hours:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Scan Lookback Hours
        include_json_paths:
          type: boolean
          title: Include Json Paths
          default: false
        event_name_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Event Name Column
        properties_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Properties Column
        json_string_columns:
          items:
            type: string
          type: array
          title: Json String Columns
      type: object
      required:
        - data_source_id
        - base_query
      title: ScanConfigPreviewRequest
    ScanConfigResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        data_source_id:
          type: string
          format: uuid
          title: Data Source Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        name:
          type: string
          title: Name
        base_query:
          type: string
          title: Base Query
        event_type_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Type Column
        time_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Time Column
        event_name_format:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Name Format
        json_value_paths:
          items:
            type: string
          type: array
          title: Json Value Paths
        event_group_rules:
          items:
            $ref: '#/components/schemas/EventGroupRule'
          type: array
          title: Event Group Rules
        setup_preset:
          type: string
          enum:
            - custom
            - event_properties
          title: Setup Preset
          default: custom
        event_name_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Name Column
        properties_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Properties Column
        json_string_columns:
          items:
            type: string
          type: array
          title: Json String Columns
        metric_breakdown_columns:
          items:
            type: string
          type: array
          title: Metric Breakdown Columns
        metric_breakdown_values_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Metric Breakdown Values Limit
        distribution_drift_fields:
          items:
            type: string
          type: array
          title: Distribution Drift Fields
        cardinality_threshold:
          type: integer
          title: Cardinality Threshold
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        replay_chunk_interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        scan_lookback_hours:
          anyOf:
            - type: integer
            - type: 'null'
          title: Scan Lookback Hours
        scan_row_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Scan Row Limit
        metrics_row_limit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Metrics Row Limit
        app_version_column:
          anyOf:
            - type: string
            - type: 'null'
          title: App Version Column
        app_version_keep_releases:
          anyOf:
            - type: integer
            - type: 'null'
          title: App Version Keep Releases
          description: >-
            Deprecated compatibility mirror of
            Project.app_version_keep_releases.
          deprecated: true
        app_version_prerelease_pattern:
          anyOf:
            - type: string
            - type: 'null'
          title: App Version Prerelease Pattern
        app_version_active_share_min:
          anyOf:
            - type: number
            - type: 'null'
          title: App Version Active Share Min
        platform_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Platform Column
        last_event_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Event At
        last_collection_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Collection At
        freshness:
          $ref: '#/components/schemas/SourceFreshness'
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        monitoring_enabled:
          type: boolean
          title: Monitoring Enabled
          description: >-
            Whether the scheduler collects metrics for this scan.


            Derived, never stored: the beat schedule and every monitoring read
            path

            select on ``interval IS NOT NULL``, so this is that test said out
            loud

            rather than a second switch that could disagree with it.
          readOnly: true
      type: object
      required:
        - id
        - data_source_id
        - project_id
        - event_type_id
        - name
        - base_query
        - event_type_column
        - time_column
        - event_name_format
        - json_value_paths
        - event_group_rules
        - metric_breakdown_columns
        - metric_breakdown_values_limit
        - distribution_drift_fields
        - cardinality_threshold
        - interval
        - replay_chunk_interval
        - scan_lookback_hours
        - scan_row_limit
        - metrics_row_limit
        - app_version_column
        - app_version_keep_releases
        - app_version_prerelease_pattern
        - app_version_active_share_min
        - platform_column
        - freshness
        - created_at
        - updated_at
        - monitoring_enabled
      title: ScanConfigResponse
    ScanConfigUpdate:
      properties:
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Name
        base_query:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Base Query
        event_type_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Type Column
        time_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Time Column
        event_name_format:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Event Name Format
        json_value_paths:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Json Value Paths
        event_group_rules:
          anyOf:
            - items:
                $ref: '#/components/schemas/EventGroupRule'
              type: array
            - type: 'null'
          title: Event Group Rules
        setup_preset:
          anyOf:
            - type: string
              enum:
                - custom
                - event_properties
            - type: 'null'
          title: Setup Preset
        event_name_column:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Event Name Column
        properties_column:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Properties Column
        json_string_columns:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Json String Columns
        metric_breakdown_columns:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Metric Breakdown Columns
        metric_breakdown_values_limit:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Metric Breakdown Values Limit
        distribution_drift_fields:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Distribution Drift Fields
        cardinality_threshold:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Cardinality Threshold
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        replay_chunk_interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        scan_lookback_hours:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Scan Lookback Hours
        scan_row_limit:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Scan Row Limit
        metrics_row_limit:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Metrics Row Limit
        app_version_column:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: App Version Column
        app_version_keep_releases:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: App Version Keep Releases
          description: >-
            Deprecated compatibility mirror of
            Project.app_version_keep_releases; caller values are ignored.
          deprecated: true
        app_version_prerelease_pattern:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: App Version Prerelease Pattern
        app_version_active_share_min:
          anyOf:
            - type: number
              exclusiveMaximum: 1
              exclusiveMinimum: 0
            - type: 'null'
          title: App Version Active Share Min
        platform_column:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Platform Column
      type: object
      title: ScanConfigUpdate
    ScanDryRunDuplicateOf:
      properties:
        event_id:
          type: string
          format: uuid
          title: Event Id
        name:
          type: string
          title: Name
        score:
          type: number
          title: Score
        status:
          type: string
          title: Status
      type: object
      required:
        - event_id
        - name
        - score
        - status
      title: ScanDryRunDuplicateOf
    ScanDryRunEvent:
      properties:
        name:
          type: string
          title: Name
        source_name:
          type: string
          title: Source Name
        event_type:
          type: string
          title: Event Type
        approx_row_count:
          type: integer
          title: Approx Row Count
        share_of_sample:
          type: number
          title: Share Of Sample
        status:
          type: string
          enum:
            - new
            - existing
          title: Status
        grouped_by_rule:
          anyOf:
            - type: string
            - type: 'null'
          title: Grouped By Rule
        count_confidence:
          type: string
          enum:
            - exact
            - sampled
          title: Count Confidence
      type: object
      required:
        - name
        - source_name
        - event_type
        - approx_row_count
        - share_of_sample
        - status
        - count_confidence
      title: ScanDryRunEvent
      description: >-
        One event the config would produce, and how much of the sample it is.


        An event is identified by ``(event_type, source_name)``, not by the name

        alone: a run writes one Event per event type, so a grouped scan whose
        name

        format collapses to the same string under two event types creates two

        Events. Listing them as one would undercount the answer this panel
        exists to

        give.
    ScanDryRunField:
      properties:
        name:
          type: string
          title: Name
        type:
          type: string
          enum:
            - json
            - string
          title: Type
        status:
          type: string
          enum:
            - new
            - exists
          title: Status
        event_type:
          type: string
          title: Event Type
      type: object
      required:
        - name
        - type
        - status
        - event_type
      title: ScanDryRunField
      description: >-
        A field the config would add to the plan.


        ``type`` is "json" or "string" and nothing else — that is the ENTIRE

        inference the scan performs (``worker.tasks.metrics.generation``).
        Promising

        integer/timestamp here would be a lie about what the scan creates.
    ScanDryRunJobResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        status:
          $ref: '#/components/schemas/ScanJobStatus'
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        result_summary:
          anyOf:
            - $ref: '#/components/schemas/ScanDryRunResponse'
            - type: 'null'
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - status
        - started_at
        - completed_at
        - result_summary
        - error_message
        - created_at
        - updated_at
      title: ScanDryRunJobResponse
    ScanDryRunNameWarning:
      properties:
        code:
          type: string
          enum:
            - combinatorial_explosion
            - duplicate
          title: Code
        event_type:
          type: string
          title: Event Type
        message:
          type: string
          title: Message
        count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Count
        slot:
          anyOf:
            - type: integer
            - type: 'null'
          title: Slot
        slot_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Slot Label
        pattern:
          anyOf:
            - type: string
            - type: 'null'
          title: Pattern
        samples:
          items:
            type: string
          type: array
          title: Samples
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        duplicate_of:
          anyOf:
            - $ref: '#/components/schemas/ScanDryRunDuplicateOf'
            - type: 'null'
      type: object
      required:
        - code
        - event_type
        - message
      title: ScanDryRunNameWarning
      description: >-
        A problem with the NAMES a run would create (GH #265).


        ``combinatorial_explosion``: more than 50 new names under one event type

        differ only in one slot (``slot`` / ``slot_label``; ``pattern`` shows
        the

        fixed parts with ``*``), i.e. a high-cardinality value is part of the
        name.

        ``duplicate``: the new event ``name`` looks like ``duplicate_of``
        already in

        the plan. Best-effort; an empty list never means "checked and clean"
        when

        the check could not run.
    ScanDryRunRequest:
      properties:
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        data_source_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Data Source Id
        base_query:
          anyOf:
            - type: string
              minLength: 1
            - type: 'null'
          title: Base Query
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        event_type_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Type Column
        time_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Time Column
        event_name_format:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Event Name Format
        event_group_rules:
          items:
            $ref: '#/components/schemas/EventGroupRule'
          type: array
          title: Event Group Rules
        json_value_paths:
          items:
            type: string
          type: array
          title: Json Value Paths
        setup_preset:
          type: string
          enum:
            - custom
            - event_properties
          title: Setup Preset
          default: custom
        event_name_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Event Name Column
        properties_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Properties Column
        json_string_columns:
          items:
            type: string
          type: array
          title: Json String Columns
        cardinality_threshold:
          type: integer
          minimum: 1
          title: Cardinality Threshold
          default: 100
        app_version_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: App Version Column
        platform_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Platform Column
        scan_lookback_hours:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Scan Lookback Hours
        sample_row_limit:
          type: integer
          maximum: 20000
          minimum: 100
          title: Sample Row Limit
          default: 5000
      type: object
      title: ScanDryRunRequest
      description: >-
        Inputs for "what would this scan create?".


        Two shapes, and exactly one of them must be supplied. The scan form has
        no

        saved config, so it sends the draft — that is the only shape the UI
        sends.

        ``scan_config_id`` is the API/agent shape
        (``integrate/agent-api-guide.md``):

        a caller that already has a stored config asks about it by id instead of

        re-serialising twenty fields it did not author, and every draft field
        below

        is then ignored. Nothing in the frontend uses it today; it is a
        documented

        capability of the HTTP API, not unfinished UI.
    ScanDryRunResponse:
      properties:
        window_from:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Window From
        window_to:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Window To
        sampled_rows:
          type: integer
          title: Sampled Rows
          default: 0
        sample_row_limit:
          type: integer
          title: Sample Row Limit
          default: 0
        sample_is_complete:
          type: boolean
          title: Sample Is Complete
          default: true
        breakdown_combinations:
          type: integer
          title: Breakdown Combinations
          default: 0
        events:
          items:
            $ref: '#/components/schemas/ScanDryRunEvent'
          type: array
          title: Events
        events_truncated:
          type: boolean
          title: Events Truncated
          default: false
        max_events_reached:
          type: boolean
          title: Max Events Reached
          default: false
        fields:
          items:
            $ref: '#/components/schemas/ScanDryRunField'
          type: array
          title: Fields
        templated_columns:
          items:
            $ref: '#/components/schemas/ScanDryRunTemplatedColumn'
          type: array
          title: Templated Columns
        reserved_columns:
          items:
            type: string
          type: array
          title: Reserved Columns
        unmapped_columns:
          items:
            type: string
          type: array
          title: Unmapped Columns
        warnings:
          items:
            type: string
          type: array
          title: Warnings
        errors:
          items:
            type: string
          type: array
          title: Errors
        name_warnings:
          items:
            $ref: '#/components/schemas/ScanDryRunNameWarning'
          type: array
          title: Name Warnings
      type: object
      title: ScanDryRunResponse
      description: >-
        What a scan would create, bounded by three separate partialities.


        1. the lookback window (``window_from`` / ``window_to``) — an event
        absent
           from 24h is not an event that will not be created;
        2. the sample (``sample_is_complete``) — when false the caller must say
           "at least N", never "N";
        3. the event cap (``max_events_reached``) — the real scan stops there
        too.


        Never extrapolate any of these to a table-wide total.
        ``share_of_sample``

        exists so the caller does not have to invent one.
    ScanDryRunTemplatedColumn:
      properties:
        column:
          type: string
          title: Column
        distinct_values:
          type: integer
          title: Distinct Values
        threshold:
          type: integer
          title: Threshold
      type: object
      required:
        - column
        - distinct_values
        - threshold
      title: ScanDryRunTemplatedColumn
      description: >-
        A column collapsed into a ``${column}`` template by the cardinality
        rule.


        Surfaced so the user can see WHY they got 3 events instead of 3000 — it
        is a

        step function of a threshold they are editing in the same form, not a

        property of their data.
    ScanInterval:
      type: string
      enum:
        - 15m
        - 1h
        - 6h
        - 1d
        - 1w
      title: ScanInterval
    ScanJobResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        status:
          $ref: '#/components/schemas/ScanJobStatus'
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        result_summary:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Result Summary
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - scan_config_id
        - status
        - started_at
        - completed_at
        - result_summary
        - error_message
        - created_at
        - updated_at
      title: ScanJobResponse
    ScanJobStatus:
      type: string
      enum:
        - pending
        - running
        - completed
        - failed
        - cancelled
      title: ScanJobStatus
    ScanMetricsReplayRequest:
      properties:
        time_from:
          type: string
          format: date-time
          title: Time From
        time_to:
          type: string
          format: date-time
          title: Time To
      type: object
      required:
        - time_from
        - time_to
      title: ScanMetricsReplayRequest
    ScanPreviewJobResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        status:
          $ref: '#/components/schemas/ScanJobStatus'
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        result_summary:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Result Summary
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - status
        - started_at
        - completed_at
        - result_summary
        - error_message
        - created_at
        - updated_at
      title: ScanPreviewJobResponse
    SchemaDriftActionRequest:
      properties:
        action:
          type: string
          enum:
            - accept
            - snooze
            - false_positive
            - reopen
          title: Action
        note:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Note
        snoozed_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Snoozed Until
        force:
          type: boolean
          title: Force
          description: >-
            Override the guard that refuses to accept a missing_field drift for
            a column a scan config's event name format builds event names from .
            API-only escape hatch for a project-wide config that names the
            column but never scans this event type; requires a note explaining
            why, which lands in the audit record. The UI does not offer it — a
            warning next to an Accept button is a thing operators click past,
            and clicking past it is what caused the outage.
          default: false
      type: object
      required:
        - action
      title: SchemaDriftActionRequest
    SchemaDriftListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/SchemaDriftResponse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
      type: object
      required:
        - items
        - total
      title: SchemaDriftListResponse
    SchemaDriftResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        field_name:
          type: string
          title: Field Name
        drift_type:
          $ref: '#/components/schemas/SchemaDriftType'
        observed_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Observed Type
        declared_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Declared Type
        sample_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Sample Value
        status:
          $ref: '#/components/schemas/SchemaDriftStatus'
          default: open
        resolution_note:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolution Note
        snoozed_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Snoozed Until
        resolved_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Resolved At
        resolved_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Resolved By
        detected_at:
          type: string
          format: date-time
          title: Detected At
      type: object
      required:
        - id
        - event_type_id
        - scan_config_id
        - field_name
        - drift_type
        - observed_type
        - declared_type
        - sample_value
        - detected_at
      title: SchemaDriftResponse
    SchemaDriftStatus:
      type: string
      enum:
        - open
        - accepted
        - snoozed
        - false_positive
      title: SchemaDriftStatus
    SchemaDriftType:
      type: string
      enum:
        - new_field
        - missing_field
        - type_changed
        - enum_violation
        - required_null_violation
        - regex_violation
        - range_violation
      title: SchemaDriftType
    SearchEventVariableValue:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        variable_id:
          type: string
          format: uuid
          title: Variable Id
        variable_name:
          type: string
          title: Variable Name
        field_definition_id:
          type: string
          format: uuid
          title: Field Definition Id
        field_name:
          type: string
          title: Field Name
        field_display_name:
          type: string
          title: Field Display Name
        source_column:
          type: string
          title: Source Column
        value_kind:
          $ref: '#/components/schemas/VariableValueKind'
        observed_count:
          type: integer
          title: Observed Count
        values:
          items:
            type: string
          type: array
          title: Values
          default: []
      type: object
      required:
        - id
        - variable_id
        - variable_name
        - field_definition_id
        - field_name
        - field_display_name
        - source_column
        - value_kind
        - observed_count
      title: SearchEventVariableValue
    SearchReindexResponse:
      properties:
        documents_indexed:
          type: integer
          minimum: 0
          title: Documents Indexed
        embeddings_scheduled:
          type: boolean
          title: Embeddings Scheduled
          default: false
      type: object
      required:
        - documents_indexed
      title: SearchReindexResponse
    SearchResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/SearchResult'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        truncated:
          type: boolean
          title: Truncated
          default: false
        semantic_used:
          type: boolean
          title: Semantic Used
          default: false
      type: object
      required:
        - items
        - total
      title: SearchResponse
    SearchResult:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        entity_type:
          type: string
          enum:
            - event
            - event_type
            - field
            - meta_field
            - variable
            - relation
            - tag
            - metric
            - fact_table
            - scan_config
            - alert_rule
            - doc
          title: Entity Type
        entity_id:
          type: string
          format: uuid
          title: Entity Id
        parent_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Parent Event Id
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        implemented:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Implemented
        variable_values:
          items:
            $ref: '#/components/schemas/SearchEventVariableValue'
          type: array
          title: Variable Values
          default: []
        title:
          type: string
          title: Title
        subtitle:
          type: string
          title: Subtitle
          default: ''
        description:
          type: string
          title: Description
          default: ''
        snippet:
          type: string
          title: Snippet
          default: ''
        route_path:
          type: string
          title: Route Path
        score:
          type: number
          title: Score
        confidence:
          type: number
          title: Confidence
          default: 0
        highlights:
          items:
            type: string
          type: array
          title: Highlights
          default: []
        semantic_used:
          type: boolean
          title: Semantic Used
          default: false
        variant_group:
          anyOf:
            - $ref: '#/components/schemas/SearchVariantGroup'
            - type: 'null'
      type: object
      required:
        - id
        - entity_type
        - entity_id
        - title
        - route_path
        - score
      title: SearchResult
    SearchVariant:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        entity_id:
          type: string
          format: uuid
          title: Entity Id
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        title:
          type: string
          title: Title
        value:
          type: string
          title: Value
        route_path:
          type: string
          title: Route Path
        score:
          type: number
          title: Score
        confidence:
          type: number
          title: Confidence
          default: 0
      type: object
      required:
        - id
        - entity_id
        - title
        - value
        - route_path
        - score
      title: SearchVariant
      description: >-
        One folded member of a :class:`SearchVariantGroup`.


        Deliberately slim — enough to render and open the event, not a second
        full

        :class:`SearchResult`: a group of 40 scan variants would otherwise carry
        40

        copies of snippets, highlights and variable bindings nobody reads until
        the

        group is expanded, and then only the name.
    SearchVariantGroup:
      properties:
        key:
          type: string
          title: Key
        pattern:
          type: string
          title: Pattern
        placeholder:
          type: string
          title: Placeholder
        count:
          type: integer
          minimum: 2
          title: Count
        variants:
          items:
            $ref: '#/components/schemas/SearchVariant'
          type: array
          title: Variants
      type: object
      required:
        - key
        - pattern
        - placeholder
        - count
        - variants
      title: SearchVariantGroup
      description: >-
        Event hits folded under their best-ranked member.


        Events of ONE event type whose names differ only in the value
        substituted

        for ONE naming-rule placeholder — the scan's ``event_name_format``, or
        the

        default ``column=value | column=value`` name a scan without one writes.

        ``search_service.group_event_variants`` owns the rule.
    SeasonalityCell:
      properties:
        weekday:
          type: integer
          title: Weekday
        hour:
          type: integer
          title: Hour
        count:
          type: integer
          title: Count
        anomaly_count:
          type: integer
          title: Anomaly Count
      type: object
      required:
        - weekday
        - hour
        - count
        - anomaly_count
      title: SeasonalityCell
      description: |-
        One cell of the 7×24 hour-of-day × weekday seasonality heatmap.

        `weekday` is ISO-style with Monday=0..Sunday=6 to match Python's
        `datetime.weekday()`. `count` is the total volume observed in that
        slot across the queried time range; `anomaly_count` is the number of
        detected anomalies whose bucket fell into the same slot.
    SeasonalityHeatmapResponse:
      properties:
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        cells:
          items:
            $ref: '#/components/schemas/SeasonalityCell'
          type: array
          title: Cells
        max_count:
          type: integer
          title: Max Count
        total_count:
          type: integer
          title: Total Count
        interval:
          type: string
          title: Interval
        hourly_resolution:
          type: boolean
          title: Hourly Resolution
      type: object
      required:
        - scan_config_id
        - scope_type
        - scope_ref
        - cells
        - max_count
        - total_count
        - interval
        - hourly_resolution
      title: SeasonalityHeatmapResponse
    SecuritySettings:
      properties:
        cors_allow_origins:
          type: string
          title: Cors Allow Origins
        session_cookie_name:
          type: string
          title: Session Cookie Name
        session_ttl_hours:
          type: integer
          title: Session Ttl Hours
        session_cookie_secure:
          type: boolean
          title: Session Cookie Secure
        security_headers_enabled:
          type: boolean
          title: Security Headers Enabled
        hsts_enabled:
          type: boolean
          title: Hsts Enabled
        hsts_max_age_seconds:
          type: integer
          title: Hsts Max Age Seconds
        content_security_policy:
          type: string
          title: Content Security Policy
        rate_limit_enabled:
          type: boolean
          title: Rate Limit Enabled
        rate_limit_login_per_minute:
          type: integer
          title: Rate Limit Login Per Minute
        rate_limit_register_per_hour:
          type: integer
          title: Rate Limit Register Per Hour
        rate_limit_trust_forwarded_for:
          type: boolean
          title: Rate Limit Trust Forwarded For
        registration_mode:
          type: string
          enum:
            - open
            - disabled
          title: Registration Mode
      type: object
      required:
        - cors_allow_origins
        - session_cookie_name
        - session_ttl_hours
        - session_cookie_secure
        - security_headers_enabled
        - hsts_enabled
        - hsts_max_age_seconds
        - content_security_policy
        - rate_limit_enabled
        - rate_limit_login_per_minute
        - rate_limit_register_per_hour
        - rate_limit_trust_forwarded_for
        - registration_mode
      title: SecuritySettings
    SecuritySettingsUpdate:
      properties:
        cors_allow_origins:
          anyOf:
            - type: string
            - type: 'null'
          title: Cors Allow Origins
        session_cookie_name:
          anyOf:
            - type: string
              maxLength: 100
              minLength: 1
            - type: 'null'
          title: Session Cookie Name
        session_ttl_hours:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Session Ttl Hours
        session_cookie_secure:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Session Cookie Secure
        security_headers_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Security Headers Enabled
        hsts_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Hsts Enabled
        hsts_max_age_seconds:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Hsts Max Age Seconds
        content_security_policy:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Security Policy
        rate_limit_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Rate Limit Enabled
        rate_limit_login_per_minute:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Rate Limit Login Per Minute
        rate_limit_register_per_hour:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Rate Limit Register Per Hour
        rate_limit_trust_forwarded_for:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Rate Limit Trust Forwarded For
        registration_mode:
          anyOf:
            - type: string
              enum:
                - open
                - disabled
            - type: 'null'
          title: Registration Mode
      type: object
      title: SecuritySettingsUpdate
    Sensitivity:
      type: string
      enum:
        - none
        - pii
        - phi
        - financial
        - secret
      title: Sensitivity
    ServiceSettingsResponse:
      properties:
        runtime:
          $ref: '#/components/schemas/RuntimeSettings'
        security:
          $ref: '#/components/schemas/SecuritySettings'
        storage:
          $ref: '#/components/schemas/StorageSettings'
        observability:
          $ref: '#/components/schemas/ObservabilitySettings'
        email:
          $ref: '#/components/schemas/EmailSettings'
        ai:
          $ref: '#/components/schemas/AiSettings'
        system:
          anyOf:
            - $ref: '#/components/schemas/SystemSettings'
            - type: 'null'
        overridden_fields:
          items:
            type: string
          type: array
          title: Overridden Fields
        sources:
          additionalProperties:
            type: string
            enum:
              - env
              - override
              - default
              - org
              - disabled
          type: object
          title: Sources
      type: object
      required:
        - runtime
        - security
        - storage
        - observability
        - email
        - ai
        - system
        - overridden_fields
        - sources
      title: ServiceSettingsResponse
    ServiceSettingsUpdate:
      properties:
        runtime:
          anyOf:
            - $ref: '#/components/schemas/RuntimeSettingsUpdate'
            - type: 'null'
        security:
          anyOf:
            - $ref: '#/components/schemas/SecuritySettingsUpdate'
            - type: 'null'
        storage:
          anyOf:
            - $ref: '#/components/schemas/StorageSettingsUpdate'
            - type: 'null'
        observability:
          anyOf:
            - $ref: '#/components/schemas/ObservabilitySettingsUpdate'
            - type: 'null'
        email:
          anyOf:
            - $ref: '#/components/schemas/EmailSettingsUpdate'
            - type: 'null'
        ai:
          anyOf:
            - $ref: '#/components/schemas/AiSettingsUpdate'
            - type: 'null'
      type: object
      title: ServiceSettingsUpdate
    SettingsTestResponse:
      properties:
        ok:
          type: boolean
          title: Ok
        message:
          type: string
          title: Message
      type: object
      required:
        - ok
        - message
      title: SettingsTestResponse
    ShadowEventAcceptRequest:
      properties:
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        name:
          anyOf:
            - type: string
              maxLength: 500
              minLength: 1
            - type: 'null'
          title: Name
      type: object
      title: ShadowEventAcceptRequest
    ShadowEventAcceptResponse:
      properties:
        candidate_id:
          type: string
          format: uuid
          title: Candidate Id
        event_id:
          type: string
          format: uuid
          title: Event Id
        status:
          $ref: '#/components/schemas/ShadowEventStatus'
      type: object
      required:
        - candidate_id
        - event_id
        - status
      title: ShadowEventAcceptResponse
    ShadowEventBatchItem:
      properties:
        candidate_id:
          type: string
          format: uuid
          title: Candidate Id
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        name:
          anyOf:
            - type: string
              maxLength: 500
              minLength: 1
            - type: 'null'
          title: Name
      type: object
      required:
        - candidate_id
      title: ShadowEventBatchItem
    ShadowEventBatchItemResult:
      properties:
        candidate_id:
          type: string
          format: uuid
          title: Candidate Id
        ok:
          type: boolean
          title: Ok
        status:
          anyOf:
            - $ref: '#/components/schemas/ShadowEventStatus'
            - type: 'null'
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        error_status:
          anyOf:
            - type: integer
            - type: 'null'
          title: Error Status
      type: object
      required:
        - candidate_id
        - ok
      title: ShadowEventBatchItemResult
      description: What happened to one row. A refused row does not stop the rest.
    ShadowEventBatchRequest:
      properties:
        action:
          type: string
          enum:
            - accept
            - dismiss
          title: Action
        items:
          items:
            $ref: '#/components/schemas/ShadowEventBatchItem'
          type: array
          maxItems: 200
          minItems: 1
          title: Items
      type: object
      required:
        - action
        - items
      title: ShadowEventBatchRequest
      description: Accept or dismiss many inbox rows in one request.
    ShadowEventBatchResponse:
      properties:
        results:
          items:
            $ref: '#/components/schemas/ShadowEventBatchItemResult'
          type: array
          title: Results
        succeeded:
          type: integer
          title: Succeeded
        failed:
          type: integer
          title: Failed
      type: object
      required:
        - results
        - succeeded
        - failed
      title: ShadowEventBatchResponse
    ShadowEventCandidateResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        scan_config_name:
          type: string
          title: Scan Config Name
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        event_type_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Type Name
        event_name:
          type: string
          title: Event Name
        observed_count:
          type: integer
          title: Observed Count
        first_seen_at:
          type: string
          format: date-time
          title: First Seen At
        last_seen_at:
          type: string
          format: date-time
          title: Last Seen At
        status:
          $ref: '#/components/schemas/ShadowEventStatus'
        accepted_event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Accepted Event Id
        sample_properties:
          items:
            additionalProperties:
              type: string
            type: object
          type: array
          title: Sample Properties
      type: object
      required:
        - id
        - scan_config_id
        - scan_config_name
        - event_type_id
        - event_type_name
        - event_name
        - observed_count
        - first_seen_at
        - last_seen_at
        - status
        - accepted_event_id
      title: ShadowEventCandidateResponse
    ShadowEventDismissResponse:
      properties:
        candidate_id:
          type: string
          format: uuid
          title: Candidate Id
        status:
          $ref: '#/components/schemas/ShadowEventStatus'
      type: object
      required:
        - candidate_id
        - status
      title: ShadowEventDismissResponse
    ShadowEventListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/ShadowEventCandidateResponse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        new_count:
          type: integer
          title: New Count
      type: object
      required:
        - items
        - total
        - new_count
      title: ShadowEventListResponse
    ShadowEventStatus:
      type: string
      enum:
        - new
        - accepted
        - dismissed
      title: ShadowEventStatus
    SignalAttribution:
      properties:
        delta:
          type: number
          title: Delta
        columns:
          items:
            $ref: '#/components/schemas/AttributionColumn'
          type: array
          title: Columns
        release:
          anyOf:
            - $ref: '#/components/schemas/AttributionRelease'
            - type: 'null'
        headline:
          anyOf:
            - type: string
            - type: 'null'
          title: Headline
        release_line:
          anyOf:
            - type: string
            - type: 'null'
          title: Release Line
        computed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Computed At
      type: object
      required:
        - delta
      title: SignalAttribution
      description: Why the signal changed, computed and stored when it was detected.
    SignalExpectedReason:
      type: string
      enum:
        - campaign
        - release
        - seasonality
        - other
      title: SignalExpectedReason
      description: |-
        Why an ``expected`` signal was expected. Documents only; it does not
        suppress later buckets.
    SignalExpectedRequest:
      properties:
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          maxLength: 64
          minLength: 1
          title: Scope Ref
        bucket:
          type: string
          format: date-time
          title: Bucket
        note:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Note
      type: object
      required:
        - scope_type
        - scope_ref
        - bucket
      title: SignalExpectedRequest
    SignalIncidentBrief:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        status:
          $ref: '#/components/schemas/AlertInboxStatus'
      type: object
      required:
        - id
        - status
      title: SignalIncidentBrief
      description: The inbox incident a signal was routed into, for a status chip + link.
    SignalMuteRequest:
      properties:
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          maxLength: 64
          minLength: 1
          title: Scope Ref
        bucket:
          type: string
          format: date-time
          title: Bucket
        duration:
          type: string
          enum:
            - 24h
            - 7d
            - until_unmuted
          title: Duration
      type: object
      required:
        - scope_type
        - scope_ref
        - bucket
        - duration
      title: SignalMuteRequest
    SignalSeriesQuery:
      properties:
        scopes:
          items:
            $ref: '#/components/schemas/SignalSeriesScope'
          type: array
          maxItems: 500
          title: Scopes
      type: object
      required:
        - scopes
      title: SignalSeriesQuery
    SignalSeriesResponse:
      properties:
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        bucket:
          type: string
          format: date-time
          title: Bucket
        interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        data:
          items:
            $ref: '#/components/schemas/BreakdownTimelinePoint'
          type: array
          title: Data
      type: object
      required:
        - scan_config_id
        - scope_type
        - scope_ref
        - bucket
        - data
      title: SignalSeriesResponse
      description: >-
        Up to ``SIGNAL_SERIES_BUCKETS`` buckets around one signal's flagged
        bucket.


        The window opens 20 buckets before ``bucket`` and closes 4 after it, so
        the

        row shows the run-up and whether the move held. Gaps inside the stored
        range

        are zero-filled (an absent row is a zero count); buckets past the newest

        stored one are simply absent.
    SignalSeriesScope:
      properties:
        scan_config_id:
          type: string
          format: uuid
          title: Scan Config Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        bucket:
          type: string
          format: date-time
          title: Bucket
      type: object
      required:
        - scan_config_id
        - scope_type
        - scope_ref
        - bucket
      title: SignalSeriesScope
      description: One open signal whose recent series a row sparkline draws.
    SignalTriageScope:
      properties:
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          maxLength: 64
          minLength: 1
          title: Scope Ref
        bucket:
          type: string
          format: date-time
          title: Bucket
      type: object
      required:
        - scope_type
        - scope_ref
        - bucket
      title: SignalTriageScope
      description: >-
        The scope a triage verdict is about, keyed like the signal itself.


        ``scan_config_id`` is NULL for a catalog ``metric`` scope and required
        for

        every other one. ``bucket`` names the signal the user acted on: the

        per-signal verdicts pin it, and a mute uses it to refuse a signal that
        was

        routed to an incident (that one is triaged in the inbox).
    SignalTriageState:
      properties:
        acknowledged_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Acknowledged At
        muted:
          type: boolean
          title: Muted
          default: false
        muted_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Muted Until
        expected:
          type: boolean
          title: Expected
          default: false
        expected_note:
          anyOf:
            - type: string
            - type: 'null'
          title: Expected Note
        hidden:
          type: boolean
          title: Hidden
          default: false
      type: object
      title: SignalTriageState
      description: >-
        The triage fields of one signal after a write, as the list would show
        them.
    SignalVerdict:
      type: string
      enum:
        - expected
        - tracking_bug
        - false_positive
        - real_issue
      title: SignalVerdict
      description: >-
        The verdict half of ``SignalTriageAction``: what a signal turned out to
        be.
    SignalVerdictCountsResponse:
      properties:
        needs_verdict:
          type: integer
          title: Needs Verdict
          default: 0
        expected:
          type: integer
          title: Expected
          default: 0
        tracking_bug:
          type: integer
          title: Tracking Bug
          default: 0
        false_positive:
          type: integer
          title: False Positive
          default: 0
        real_issue:
          type: integer
          title: Real Issue
          default: 0
      type: object
      title: SignalVerdictCountsResponse
      description: >-
        Verdicts over the project's open signals (the expanded Anomalies list).


        ``needs_verdict`` counts signals with no verdict that no mute or

        ``expected`` hides; the other four count signals by verdict, whether the

        signal's own row or its incident's status supplied it (F15 health
        score).
    SignalVerdictInfo:
      properties:
        verdict:
          $ref: '#/components/schemas/SignalVerdict'
        expected_reason:
          anyOf:
            - $ref: '#/components/schemas/SignalExpectedReason'
            - type: 'null'
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
        author_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Name
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        source:
          type: string
          enum:
            - signal
            - incident
          title: Source
      type: object
      required:
        - verdict
        - source
      title: SignalVerdictInfo
      description: >-
        What a signal turned out to be (F01, #254).


        ``source`` is ``signal`` when the signal's own verdict row supplies it
        and

        ``incident`` when it is read off the status of the incident the signal
        was

        routed into (the incident is the source of truth): acknowledged reads as

        ``real_issue``, resolved as ``expected``, false_positive as

        ``false_positive``. A signal verdict row consistent with the incident's

        status refines that reading (``tracking_bug`` on an acknowledged
        incident,

        a reason on an expected one) and wins; one the incident has since moved

        away from is ignored.
    SignalVerdictRequest:
      properties:
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          maxLength: 64
          minLength: 1
          title: Scope Ref
        bucket:
          type: string
          format: date-time
          title: Bucket
        verdict:
          $ref: '#/components/schemas/SignalVerdict'
        expected_reason:
          anyOf:
            - $ref: '#/components/schemas/SignalExpectedReason'
            - type: 'null'
        note:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Note
      type: object
      required:
        - scope_type
        - scope_ref
        - bucket
        - verdict
      title: SignalVerdictRequest
      description: >-
        ``POST /projects/{slug}/signals/verdict`` (F01, #254).


        ``expected_reason`` belongs to ``expected`` only. ``note`` is free text
        on

        every verdict; on ``expected`` it is also the chart annotation's text.
    SignalVerdictResponse:
      properties:
        acknowledged_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Acknowledged At
        muted:
          type: boolean
          title: Muted
          default: false
        muted_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Muted Until
        expected:
          type: boolean
          title: Expected
          default: false
        expected_note:
          anyOf:
            - type: string
            - type: 'null'
          title: Expected Note
        hidden:
          type: boolean
          title: Hidden
          default: false
        verdict:
          anyOf:
            - $ref: '#/components/schemas/SignalVerdictInfo'
            - type: 'null'
        incident:
          anyOf:
            - $ref: '#/components/schemas/SignalIncidentBrief'
            - type: 'null'
      type: object
      title: SignalVerdictResponse
      description: The signal's triage fields, verdict and incident after a verdict write.
    SimulatedRuleFiring:
      properties:
        anomaly_id:
          type: string
          format: uuid
          title: Anomaly Id
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        scope_type:
          $ref: '#/components/schemas/MetricScopeType'
        scope_ref:
          type: string
          title: Scope Ref
        scope_name:
          type: string
          title: Scope Name
        event_type_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Type Id
        event_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Event Id
        drift_field:
          anyOf:
            - type: string
            - type: 'null'
          title: Drift Field
        drift_type:
          anyOf:
            - $ref: '#/components/schemas/AlertDriftType'
            - type: 'null'
        sample_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Sample Value
        bucket:
          type: string
          format: date-time
          title: Bucket
        window_from:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Window From
        direction:
          $ref: '#/components/schemas/AnomalyDirection'
        actual_count:
          type: number
          title: Actual Count
        expected_count:
          type: number
          title: Expected Count
        absolute_delta:
          type: number
          title: Absolute Delta
        percent_delta:
          anyOf:
            - type: number
            - type: 'null'
          title: Percent Delta
        rendered_item:
          anyOf:
            - type: string
            - type: 'null'
          title: Rendered Item
      type: object
      required:
        - anomaly_id
        - scope_type
        - scope_ref
        - scope_name
        - event_type_id
        - event_id
        - bucket
        - direction
        - actual_count
        - expected_count
        - absolute_delta
        - percent_delta
      title: SimulatedRuleFiring
      description: One virtual delivery the rule would have triggered during the window.
    SourceFreshness:
      properties:
        status:
          type: string
          enum:
            - fresh
            - late
            - overdue
            - unknown
          title: Status
        lag_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Lag Seconds
        last_event_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Event At
        last_collection_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Collection At
        expected_by:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expected By
      type: object
      required:
        - status
      title: SourceFreshness
      description: >-
        How current a scan's source data is (#269). Computed, never stored.


        ``fresh`` — events are arriving and the scan is running on schedule.

        ``late`` — the newest event is older than the scan's lateness allowance

        (``max(3 x interval, settling window + interval)``).

        ``overdue`` — the scan itself has not completed a collection within

        ``2 x interval``; wins over ``late``.

        ``unknown`` — the scan has no schedule (manual only) or nothing recorded
        yet.


        ``lag_seconds`` is ``now - last_event_at``; ``expected_by`` the moment
        the

        source counts (or counted) as late: ``last_event_at`` plus the
        allowance.
    SourceFreshnessItem:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        data_source_id:
          type: string
          format: uuid
          title: Data Source Id
        freshness:
          $ref: '#/components/schemas/SourceFreshness'
      type: object
      required:
        - id
        - name
        - data_source_id
        - freshness
      title: SourceFreshnessItem
      description: One scan config's freshness, for Overview and data-source cards.
    SqlConfig:
      properties:
        metric_sql:
          type: string
          minLength: 1
          title: Metric Sql
        time_column:
          type: string
          maxLength: 255
          minLength: 1
          title: Time Column
        value_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Value Column
      additionalProperties: false
      type: object
      required:
        - metric_sql
        - time_column
      title: SqlConfig
      description: 'Config JSON for a ``sql`` metric: a user-authored per-bucket SELECT/CTE.'
    SqlMetricCreate:
      properties:
        kind:
          type: string
          const: sql
          title: Kind
          default: sql
        config:
          $ref: '#/components/schemas/SqlConfig'
        data_source_id:
          type: string
          format: uuid
          title: Data Source Id
        interval:
          $ref: '#/components/schemas/ScanInterval'
        replay_chunk_interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        display_name:
          type: string
          maxLength: 255
          minLength: 1
          title: Display Name
        description:
          type: string
          title: Description
          default: ''
        color:
          type: string
          pattern: ^#[0-9a-fA-F]{6}$
          title: Color
          default: '#6366f1'
        order:
          anyOf:
            - type: integer
            - type: 'null'
          title: Order
        unit:
          anyOf:
            - type: string
              maxLength: 50
            - type: 'null'
          title: Unit
        status:
          $ref: '#/components/schemas/MetricStatus'
          default: draft
        owner_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Owner Id
        reviewed:
          type: boolean
          title: Reviewed
          default: false
        breakdown_columns:
          items:
            type: string
          type: array
          title: Breakdown Columns
        breakdown_values_limit:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Breakdown Values Limit
        app_version_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: App Version Column
        platform_column:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Platform Column
        anomaly_detection_enabled:
          type: boolean
          title: Anomaly Detection Enabled
          default: true
      type: object
      required:
        - config
        - data_source_id
        - interval
        - name
        - display_name
      title: SqlMetricCreate
    SqlMetricDefinition:
      properties:
        kind:
          type: string
          const: sql
          title: Kind
          default: sql
        config:
          $ref: '#/components/schemas/SqlConfig'
        data_source_id:
          type: string
          format: uuid
          title: Data Source Id
        interval:
          $ref: '#/components/schemas/ScanInterval'
        replay_chunk_interval:
          anyOf:
            - $ref: '#/components/schemas/ScanInterval'
            - type: 'null'
      type: object
      required:
        - config
        - data_source_id
        - interval
      title: SqlMetricDefinition
      description: 'Kind + collection config for a ``sql`` metric: SELECT + its data source.'
    StorageSettings:
      properties:
        photo_storage_backend:
          type: string
          title: Photo Storage Backend
        photo_local_dir:
          type: string
          title: Photo Local Dir
        photo_max_size_mb:
          type: integer
          title: Photo Max Size Mb
        photo_allowed_mime:
          type: string
          title: Photo Allowed Mime
        gcs_photo_bucket:
          type: string
          title: Gcs Photo Bucket
        gcs_photo_credentials_path:
          type: string
          title: Gcs Photo Credentials Path
        gcs_photo_public:
          type: boolean
          title: Gcs Photo Public
        gcs_photo_signed_url_ttl_seconds:
          type: integer
          title: Gcs Photo Signed Url Ttl Seconds
      type: object
      required:
        - photo_storage_backend
        - photo_local_dir
        - photo_max_size_mb
        - photo_allowed_mime
        - gcs_photo_bucket
        - gcs_photo_credentials_path
        - gcs_photo_public
        - gcs_photo_signed_url_ttl_seconds
      title: StorageSettings
    StorageSettingsUpdate:
      properties:
        photo_storage_backend:
          anyOf:
            - type: string
            - type: 'null'
          title: Photo Storage Backend
        photo_local_dir:
          anyOf:
            - type: string
            - type: 'null'
          title: Photo Local Dir
        photo_max_size_mb:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Photo Max Size Mb
        photo_allowed_mime:
          anyOf:
            - type: string
            - type: 'null'
          title: Photo Allowed Mime
        gcs_photo_bucket:
          anyOf:
            - type: string
            - type: 'null'
          title: Gcs Photo Bucket
        gcs_photo_credentials_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Gcs Photo Credentials Path
        gcs_photo_public:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Gcs Photo Public
        gcs_photo_signed_url_ttl_seconds:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Gcs Photo Signed Url Ttl Seconds
      type: object
      title: StorageSettingsUpdate
    SubscriptionMuteRequest:
      properties:
        muted:
          type: boolean
          title: Muted
      type: object
      required:
        - muted
      title: SubscriptionMuteRequest
    SubscriptionState:
      properties:
        entity_type:
          type: string
          enum:
            - event
            - event_type
            - metric
            - branch
          title: Entity Type
        entity_id:
          type: string
          format: uuid
          title: Entity Id
        watching:
          type: boolean
          title: Watching
        muted:
          type: boolean
          title: Muted
        reasons:
          items:
            type: string
            enum:
              - author
              - owner
              - commenter
              - reviewer
              - manual
          type: array
          title: Reasons
      type: object
      required:
        - entity_type
        - entity_id
        - watching
        - muted
        - reasons
      title: SubscriptionState
    SuggestedWindowResponse:
      properties:
        starts_at:
          type: string
          format: date-time
          title: Starts At
        ends_at:
          type: string
          format: date-time
          title: Ends At
      type: object
      required:
        - starts_at
        - ends_at
      title: SuggestedWindowResponse
    SyntheticSettings:
      properties: {}
      additionalProperties: false
      type: object
      title: SyntheticSettings
      description: >-
        The synthetic (demo) warehouse is in-memory: it has nothing to
        configure.
    SystemSettings:
      properties:
        debug:
          type: boolean
          title: Debug
        database_url_configured:
          type: boolean
          title: Database Url Configured
        sync_database_url_configured:
          type: boolean
          title: Sync Database Url Configured
        rabbitmq_url_configured:
          type: boolean
          title: Rabbitmq Url Configured
        redis_url_configured:
          type: boolean
          title: Redis Url Configured
        encryption_key_configured:
          type: boolean
          title: Encryption Key Configured
        openai_api_key_configured:
          type: boolean
          title: Openai Api Key Configured
        alembic_revision:
          anyOf:
            - type: string
            - type: 'null'
          title: Alembic Revision
        alembic_head_revision:
          anyOf:
            - type: string
            - type: 'null'
          title: Alembic Head Revision
        alembic_up_to_date:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Alembic Up To Date
      type: object
      required:
        - debug
        - database_url_configured
        - sync_database_url_configured
        - rabbitmq_url_configured
        - redis_url_configured
        - encryption_key_configured
        - openai_api_key_configured
      title: SystemSettings
    TableSchema:
      properties:
        name:
          type: string
          title: Name
        columns:
          items:
            $ref: '#/components/schemas/ColumnSchema'
          type: array
          title: Columns
      type: object
      required:
        - name
        - columns
      title: TableSchema
    TelemetryStatusResponse:
      properties:
        enabled:
          type: boolean
          title: Enabled
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        endpoint:
          type: string
          title: Endpoint
        instance_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Instance Id
        last_attempt_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Attempt At
        last_delivered:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Last Delivered
        last_payload:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Last Payload
      type: object
      required:
        - enabled
        - endpoint
      title: TelemetryStatusResponse
      description: >-
        ``GET /platform/settings/telemetry``: the opt-in usage ping, and the
        last one sent.
    TestStatus:
      type: string
      enum:
        - success
        - failed
      title: TestStatus
    TopEventResponse:
      properties:
        event_id:
          type: string
          format: uuid
          title: Event Id
        name:
          type: string
          title: Name
        event_type_id:
          type: string
          format: uuid
          title: Event Type Id
        total_count:
          type: integer
          title: Total Count
        window_total_count:
          type: integer
          title: Window Total Count
          default: 0
      type: object
      required:
        - event_id
        - name
        - event_type_id
        - total_count
      title: TopEventResponse
      description: One row of the Overview "Top events by volume" widget.
    TopMoverItem:
      properties:
        breakdown_column:
          type: string
          title: Breakdown Column
        breakdown_value:
          type: string
          title: Breakdown Value
        is_other:
          type: boolean
          title: Is Other
        actual_count:
          type: number
          title: Actual Count
        expected_count:
          type: number
          title: Expected Count
        stddev:
          type: number
          title: Stddev
        z_score:
          type: number
          title: Z Score
        direction:
          $ref: '#/components/schemas/AnomalyDirection'
      type: object
      required:
        - breakdown_column
        - breakdown_value
        - is_other
        - actual_count
        - expected_count
        - stddev
        - z_score
        - direction
      title: TopMoverItem
      description: One row of "what moved this anomaly" — backed by MetricBreakdownAnomaly.
    UnreadCountResponse:
      properties:
        unread:
          type: integer
          title: Unread
      type: object
      required:
        - unread
      title: UnreadCountResponse
    UpdateBlocker:
      properties:
        kind:
          type: string
          enum:
            - incomplete_base_snapshot
            - ambiguous
            - identity_clash
          title: Kind
        entity_type:
          anyOf:
            - type: string
              enum:
                - event_type
                - field_definition
                - event
                - variable
                - meta_field
                - relation
            - type: 'null'
          title: Entity Type
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        message:
          type: string
          title: Message
      type: object
      required:
        - kind
        - message
      title: UpdateBlocker
      description: >-
        Something that stops an update whatever is chosen, and what to do about
        it.


        ``kind``: ``incomplete_base_snapshot`` (the base predates complete merge

        baselines), ``ambiguous`` (main changed a row this branch holds more
        than

        once under one name, on a branch opened before origin ids) or

        ``identity_clash`` (a row of main's and one of the branch's own would
        share

        a name or ``source_name``; rename the branch's one).
    UpdateFromMainPreview:
      properties:
        behind:
          type: boolean
          title: Behind
        updatable:
          type: boolean
          title: Updatable
          default: true
        blockers:
          items:
            $ref: '#/components/schemas/UpdateBlocker'
          type: array
          title: Blockers
        base_revision_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Base Revision Id
        main_hash:
          type: string
          title: Main Hash
        main_changes:
          items:
            $ref: '#/components/schemas/EntityChangeCount'
          type: array
          title: Main Changes
        conflicts:
          $ref: '#/components/schemas/BranchConflictsResponse'
      type: object
      required:
        - behind
        - base_revision_id
        - main_hash
        - main_changes
        - conflicts
      title: UpdateFromMainPreview
    UpdateFromMainRequest:
      properties:
        expected_main_hash:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: Expected Main Hash
        resolutions:
          items:
            $ref: '#/components/schemas/ResolutionCreate'
          type: array
          maxItems: 5000
          title: Resolutions
      type: object
      title: UpdateFromMainRequest
    UpdateFromMainResult:
      properties:
        updated:
          type: boolean
          title: Updated
        branch:
          $ref: '#/components/schemas/PlanBranchDetailResponse'
        applied:
          items:
            $ref: '#/components/schemas/EntityChangeCount'
          type: array
          title: Applied
        previous_base_revision_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Previous Base Revision Id
        base_revision_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Base Revision Id
      type: object
      required:
        - updated
        - branch
        - applied
        - previous_base_revision_id
        - base_revision_id
      title: UpdateFromMainResult
    UserListItem:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        email:
          type: string
          title: Email
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        role:
          $ref: '#/components/schemas/OrganizationRole'
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - email
        - name
        - role
        - created_at
      title: UserListItem
      description: |-
        A member of the request's organization, with their organization role.

        Built explicitly by ``user_service`` from the membership row, never
        validated from a ``User`` (whose ``role`` is the unread legacy column).
    UserRoleUpdate:
      properties:
        role:
          $ref: '#/components/schemas/OrganizationRole'
      type: object
      required:
        - role
      title: UserRoleUpdate
      description: >-
        ``PATCH /users/{id}``: the target's new ORGANIZATION role.


        The vocabulary is the organization's: ``owner``, ``admin`` or
        ``member``.

        The instance-era values map as ``owner`` -> ``owner`` and ``editor`` /

        ``viewer`` -> ``member`` (write rights inside a project are the project

        role's business); they are not accepted here any more (422).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    VariableBulkDelete:
      properties:
        variable_ids:
          items:
            type: string
            format: uuid
          type: array
          minItems: 1
          title: Variable Ids
      type: object
      required:
        - variable_ids
      title: VariableBulkDelete
    VariableBulkUpdate:
      properties:
        variable_ids:
          items:
            type: string
            format: uuid
          type: array
          minItems: 1
          title: Variable Ids
        variable_type:
          anyOf:
            - $ref: '#/components/schemas/VariableType'
            - type: 'null'
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        allowed_values_add:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Values Add
        allowed_values_remove:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Values Remove
      type: object
      required:
        - variable_ids
      title: VariableBulkUpdate
    VariableCreate:
      properties:
        name:
          type: string
          maxLength: 100
          minLength: 1
          pattern: ^[a-z][a-z0-9_]*$
          title: Name
        variable_type:
          $ref: '#/components/schemas/VariableType'
          default: string
        description:
          type: string
          title: Description
          default: ''
        allowed_values:
          items:
            type: string
          type: array
          maxItems: 500
          title: Allowed Values
        bindings:
          items:
            type: string
          type: array
          maxItems: 100
          title: Bindings
        json_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Json Schema
          description: >-
            JSON Schema fragment refining variable_type: type, format, items,
            properties, required and the numeric, string and array constraints.
            Must agree with variable_type (number may narrow to integer, json is
            an object or array). Documented values stay in allowed_values. null:
            the type is just variable_type.
      type: object
      required:
        - name
      title: VariableCreate
    VariableEventOverrideResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        variable_id:
          type: string
          format: uuid
          title: Variable Id
        event_id:
          type: string
          format: uuid
          title: Event Id
        event_name:
          type: string
          title: Event Name
        values:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Values
        required:
          type: boolean
          title: Required
          default: false
      type: object
      required:
        - id
        - variable_id
        - event_id
        - event_name
      title: VariableEventOverrideResponse
    VariableEventOverrideUpsert:
      properties:
        values:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 500
            - type: 'null'
          title: Values
          description: >-
            Allowed values for this event, replacing the variable's global list.
            null: no override, the global list applies.
        required:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Required
          description: Whether every occurrence of the event must carry this property.
      type: object
      title: VariableEventOverrideUpsert
      description: |-
        Add the variable to the event's property list, or edit its entry.

        A patch: a field left out keeps what the entry holds, and a new entry
        starts with no override and not required. ``values: null`` removes the
        override and keeps the property; deleting the entry removes both.
    VariableEventRef:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - name
      title: VariableEventRef
      description: One event a variable was observed in, with the id a link needs.
    VariableListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/VariableResponse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
      type: object
      required:
        - items
        - total
      title: VariableListResponse
    VariableResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        name:
          type: string
          title: Name
        source_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Name
        variable_type:
          $ref: '#/components/schemas/VariableType'
        description:
          type: string
          title: Description
        allowed_values:
          items:
            type: string
          type: array
          title: Allowed Values
          default: []
        bindings:
          items:
            type: string
          type: array
          title: Bindings
          default: []
        excluded_from_scans:
          type: boolean
          title: Excluded From Scans
          default: false
        json_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Json Schema
        event_count:
          type: integer
          title: Event Count
          default: 0
        context_count:
          type: integer
          title: Context Count
          default: 0
        low_context_count:
          type: integer
          title: Low Context Count
          default: 0
        high_context_count:
          type: integer
          title: High Context Count
          default: 0
        sample_values:
          items:
            type: string
          type: array
          maxItems: 20
          title: Sample Values
          description: >-
            Observed values unioned across every (variable, event, field)
            context, de-duplicated and capped at 20. Lets a list client render
            the row's value chips without one /values call per variable.
          default: []
        open_drift_count:
          type: integer
          title: Open Drift Count
          default: 0
        listed_event_count:
          type: integer
          title: Listed Event Count
          description: >-
            Events whose property list carries this property (F23), on the
            property's branch; unlike 'event_count', which counts where scans
            saw it.
          default: 0
        required_event_count:
          type: integer
          title: Required Event Count
          description: Of 'listed_event_count', the events that require the property.
          default: 0
        event_names:
          items:
            type: string
          type: array
          maxItems: 20
          title: Event Names
          description: >-
            Distinct names of the events this variable was observed in,
            alphabetical and capped at 20. 'event_count' carries the untruncated
            total; fetch /variables/{id}/values for the full per-event
            breakdown.
          default: []
        event_refs:
          items:
            $ref: '#/components/schemas/VariableEventRef'
          type: array
          maxItems: 20
          title: Event Refs
          description: >-
            The events this variable was observed in, as id + name so each can
            link to its event. Ordered by name (then id) and capped at 20, like
            'event_names'; 'event_count' carries the untruncated total.
          default: []
      type: object
      required:
        - id
        - project_id
        - name
        - source_name
        - variable_type
        - description
      title: VariableResponse
    VariableRetirementCounts:
      properties:
        scanned:
          type: integer
          title: Scanned
        retirable:
          type: integer
          title: Retirable
        retired:
          type: integer
          title: Retired
        kept_referenced:
          type: integer
          title: Kept Referenced
          default: 0
        kept_observed:
          type: integer
          title: Kept Observed
          default: 0
        kept_documented:
          type: integer
          title: Kept Documented
          default: 0
        kept_user_edited:
          type: integer
          title: Kept User Edited
          default: 0
        kept_excluded:
          type: integer
          title: Kept Excluded
          default: 0
      type: object
      required:
        - scanned
        - retirable
        - retired
      title: VariableRetirementCounts
      description: >-
        What a retirement pass did, and why it spared everything it spared.


        The ``kept_*`` fields mirror ``core.variable_retirement.KeptReason`` one
        for

        one, and a test pins that agreement: a reason the core can emit but this

        schema cannot name would be dropped silently from the operator's
        preview,

        which is the one number they are being asked to trust.
    VariableRetirementRequest:
      properties:
        mode:
          type: string
          enum:
            - delete
            - exclude
          title: Mode
          default: delete
        dry_run:
          type: boolean
          title: Dry Run
          default: true
      type: object
      title: VariableRetirementRequest
      description: >-
        How to retire the variables nothing references, and whether to commit.


        ``dry_run`` defaults to true so the destructive verb takes a second,

        explicit call: the counts come back broken down by reason first, and
        only

        then does an operator decide.
    VariableType:
      type: string
      enum:
        - string
        - number
        - boolean
        - date
        - datetime
        - json
        - string_array
        - number_array
      title: VariableType
    VariableUpdate:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 100
              minLength: 1
            - type: 'null'
          title: Name
        variable_type:
          anyOf:
            - $ref: '#/components/schemas/VariableType'
            - type: 'null'
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        allowed_values:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 500
            - type: 'null'
          title: Allowed Values
        bindings:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 100
            - type: 'null'
          title: Bindings
        excluded_from_scans:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Excluded From Scans
        json_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Json Schema
          description: >-
            JSON Schema fragment refining variable_type: type, format, items,
            properties, required and the numeric, string and array constraints.
            Must agree with variable_type (number may narrow to integer, json is
            an object or array). Documented values stay in allowed_values. null:
            the type is just variable_type.
      type: object
      title: VariableUpdate
    VariableValueContextResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        variable_id:
          type: string
          format: uuid
          title: Variable Id
        variable_name:
          type: string
          title: Variable Name
        event_id:
          type: string
          format: uuid
          title: Event Id
        event_name:
          type: string
          title: Event Name
        field_definition_id:
          type: string
          format: uuid
          title: Field Definition Id
        field_name:
          type: string
          title: Field Name
        field_display_name:
          type: string
          title: Field Display Name
        source_column:
          type: string
          title: Source Column
        value_kind:
          $ref: '#/components/schemas/VariableValueKind'
        observed_count:
          type: integer
          title: Observed Count
        values:
          items:
            type: string
          type: array
          title: Values
          default: []
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - variable_id
        - variable_name
        - event_id
        - event_name
        - field_definition_id
        - field_name
        - field_display_name
        - source_column
        - value_kind
        - observed_count
        - updated_at
      title: VariableValueContextResponse
    VariableValueDriftActionRequest:
      properties:
        action:
          type: string
          enum:
            - accept
            - snooze
            - false_positive
            - reopen
          title: Action
        scope:
          type: string
          enum:
            - global
            - event
          title: Scope
          default: global
        note:
          anyOf:
            - type: string
              maxLength: 2000
            - type: 'null'
          title: Note
        snoozed_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Snoozed Until
      type: object
      required:
        - action
      title: VariableValueDriftActionRequest
    VariableValueDriftListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/VariableValueDriftResponse'
          type: array
          title: Items
        total:
          type: integer
          title: Total
      type: object
      required:
        - items
        - total
      title: VariableValueDriftListResponse
    VariableValueDriftResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        variable_id:
          type: string
          format: uuid
          title: Variable Id
        variable_name:
          type: string
          title: Variable Name
        event_id:
          type: string
          format: uuid
          title: Event Id
        event_name:
          type: string
          title: Event Name
        scan_config_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Config Id
        observed_values:
          items:
            type: string
          type: array
          title: Observed Values
          default: []
        status:
          $ref: '#/components/schemas/SchemaDriftStatus'
          default: open
        resolution_note:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolution Note
        snoozed_until:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Snoozed Until
        resolved_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Resolved At
        resolved_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Resolved By
        detected_at:
          type: string
          format: date-time
          title: Detected At
      type: object
      required:
        - id
        - variable_id
        - variable_name
        - event_id
        - event_name
        - scan_config_id
        - detected_at
      title: VariableValueDriftResponse
    VariableValueKind:
      type: string
      enum:
        - low
        - high
      title: VariableValueKind
    VerifyEmailConfirmRequest:
      properties:
        token:
          type: string
          maxLength: 512
          minLength: 1
          title: Token
      type: object
      required:
        - token
      title: VerifyEmailConfirmRequest
      description: >-
        ``POST /auth/verify-email/confirm``: the raw token from the emailed
        link.
tags:
  - name: auth
    description: Login, registration, logout, and current-user lookup.
  - name: users
    description: User administration and role management.
  - name: projects
    description: Projects (tracking plans) and their lifecycle.
  - name: events
    description: Tracked events within a project's plan.
  - name: event-types
    description: Event type definitions and metadata.
  - name: event-type-owners
    description: Ownership assignments for event types.
  - name: fields
    description: Field definitions attached to event types.
  - name: meta-fields
    description: Project-wide meta/context fields.
  - name: properties
    description: >-
      Event properties: typed, documented values referenced by the plan
      (`${name}`), with per-event lists and drift.
  - name: variables
    description: Deprecated alias of `properties` (the former name), kept for one release.
  - name: relations
    description: Relationships between plan entities.
  - name: scans
    description: Scan configs and warehouse scan/preview jobs.
  - name: metrics
    description: Computed metrics and metric definitions.
  - name: reconciliation
    description: Plan-vs-warehouse reconciliation runs.
  - name: plan-branches
    description: Working branches of a tracking plan.
  - name: dependencies
    description: What depends on a plan entity, and what a planned change affects.
  - name: plan-revisions
    description: Committed plan revisions and history.
  - name: plan-validation
    description: Check tracking calls or captured payloads against the plan (tripl check).
  - name: plan-export
    description: Export the plan as JSON Schema or as a model for tripl codegen.
  - name: chart-annotations
    description: Annotations overlaid on metric charts.
  - name: anomaly-settings
    description: Per-project anomaly detection settings.
  - name: alerting
    description: Alert rules and delivery destinations.
  - name: data-sources
    description: Warehouse/data-source connections and secrets.
  - name: event-photos
    description: Photo attachments for events.
  - name: search
    description: Hybrid lexical/semantic search over plan content.
  - name: ai
    description: AI-assisted descriptions and Q&A.
  - name: activity
    description: Recent activity feed.
  - name: audit
    description: Audit log of mutating actions.
  - name: api-keys
    description: Personal API keys for programmatic access.
  - name: settings
    description: Instance-level application settings.
