# Generated by npm run generate:openapi. Edit packages/api/src/api-contract.ts.
openapi: 3.1.0
info:
  title: Factorize API
  version: 1.0.0
  description: Versioned Factorize REST API. See the hosted docs for examples and OAuth discovery.
  x-dashboard-auth: Access-token and authorized-client management and trace replay operations require an interactive owner session; all other operations accept a suitably scoped bearer token or owner session.
servers:
  - url: https://app.factorize.sh
security:
  - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: OAuth2
    cookieAuth:
      type: apiKey
      in: cookie
      name: factorize_session
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
    Run:
      type: object
      properties:
        id:
          type: string
        job_id:
          type: string
        project_id:
          type: string
        project_name:
          type: string
        job_name:
          type: string
        issue_id:
          type: string
        issue_url:
          type:
            - string
            - "null"
        issue_title:
          type: string
        run_name:
          type: string
        agent_name:
          type: string
        workspace_name:
          type: string
        agent_kind:
          type: string
        state:
          type: string
          enum:
            - queued
            - reserved
            - starting
            - running
            - blocked
            - stopping
            - succeeded
            - failed
            - stopped
            - done
            - ignored
        provider:
          type: string
        backend_kind:
          type: string
        capabilities:
          type: array
          items:
            type: string
        destination_url:
          type:
            - string
            - "null"
        artifact_state:
          type: string
          enum:
            - pending
            - collecting
            - stored
            - partial
            - failed
        artifact_error:
          type:
            - string
            - "null"
        created_at:
          type: string
        updated_at:
          type: string
        started_at:
          type:
            - string
            - "null"
        failure_source:
          anyOf:
            - type: string
              enum:
                - system
                - agent
            - type: "null"
        agent_error:
          anyOf:
            - type: object
              properties:
                reason:
                  type: string
                reported_at:
                  type: string
                reporter:
                  type: object
                  properties:
                    user_id:
                      type: string
                    kind:
                      type: string
                      enum:
                        - api_key
                        - oauth
                        - session
                    id:
                      type: string
                  required:
                    - user_id
                    - kind
                    - id
                  additionalProperties: false
              required:
                - reason
                - reported_at
                - reporter
              additionalProperties: false
            - type: "null"
        elapsed_time:
          anyOf:
            - anyOf:
                - type: object
                  properties:
                    duration:
                      type: number
                  required:
                    - duration
                  additionalProperties: false
                - type: object
                  properties:
                    low:
                      type: number
                    high:
                      type: number
                  required:
                    - low
                    - high
                  additionalProperties: false
            - type: "null"
      required:
        - id
        - job_id
        - job_name
        - issue_id
        - issue_url
        - issue_title
        - run_name
        - agent_name
        - workspace_name
        - agent_kind
        - state
        - provider
        - backend_kind
        - capabilities
        - destination_url
        - artifact_state
        - artifact_error
        - created_at
        - updated_at
        - started_at
        - failure_source
        - agent_error
      additionalProperties: true
    RunPage:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              job_id:
                type: string
              project_id:
                type: string
              project_name:
                type: string
              job_name:
                type: string
              issue_id:
                type: string
              issue_url:
                type:
                  - string
                  - "null"
              issue_title:
                type: string
              run_name:
                type: string
              agent_name:
                type: string
              workspace_name:
                type: string
              agent_kind:
                type: string
              state:
                type: string
                enum:
                  - queued
                  - reserved
                  - starting
                  - running
                  - blocked
                  - stopping
                  - succeeded
                  - failed
                  - stopped
                  - done
                  - ignored
              provider:
                type: string
              backend_kind:
                type: string
              capabilities:
                type: array
                items:
                  type: string
              destination_url:
                type:
                  - string
                  - "null"
              artifact_state:
                type: string
                enum:
                  - pending
                  - collecting
                  - stored
                  - partial
                  - failed
              artifact_error:
                type:
                  - string
                  - "null"
              created_at:
                type: string
              updated_at:
                type: string
              started_at:
                type:
                  - string
                  - "null"
              failure_source:
                anyOf:
                  - type: string
                    enum:
                      - system
                      - agent
                  - type: "null"
              agent_error:
                anyOf:
                  - type: object
                    properties:
                      reason:
                        type: string
                      reported_at:
                        type: string
                      reporter:
                        type: object
                        properties:
                          user_id:
                            type: string
                          kind:
                            type: string
                            enum:
                              - api_key
                              - oauth
                              - session
                          id:
                            type: string
                        required:
                          - user_id
                          - kind
                          - id
                        additionalProperties: false
                    required:
                      - reason
                      - reported_at
                      - reporter
                    additionalProperties: false
                  - type: "null"
              elapsed_time:
                anyOf:
                  - anyOf:
                      - type: object
                        properties:
                          duration:
                            type: number
                        required:
                          - duration
                        additionalProperties: false
                      - type: object
                        properties:
                          low:
                            type: number
                          high:
                            type: number
                        required:
                          - low
                          - high
                        additionalProperties: false
                  - type: "null"
            required:
              - id
              - job_id
              - job_name
              - issue_id
              - issue_url
              - issue_title
              - run_name
              - agent_name
              - workspace_name
              - agent_kind
              - state
              - provider
              - backend_kind
              - capabilities
              - destination_url
              - artifact_state
              - artifact_error
              - created_at
              - updated_at
              - started_at
              - failure_source
              - agent_error
            additionalProperties: false
        nextCursor:
          type:
            - string
            - "null"
      required:
        - items
        - nextCursor
      additionalProperties: false
    ExecutionDiagnostics:
      type:
        - object
        - "null"
      description: First terminal backend observation, retained independently of collection and cleanup errors. Null for older or nonterminal runs. Commands and raw backend responses are never included.
      required:
        - state
        - detail
        - systemd
      properties:
        state:
          type: string
          enum:
            - succeeded
            - failed
            - stopped
        detail:
          type:
            - string
            - "null"
          maxLength: 2048
          description: Bounded credential-redacted backend observation detail
        systemd:
          type:
            - object
            - "null"
          required:
            - loadState
            - activeState
            - subState
            - result
            - execMainCode
            - execMainStatus
          properties:
            loadState:
              type: string
              maxLength: 64
            activeState:
              type: string
              maxLength: 64
            subState:
              type: string
              maxLength: 64
            result:
              type: string
              maxLength: 64
            execMainCode:
              type:
                - integer
                - "null"
              description: systemd ExecMainCode (for example 1 for exit and 2 for signal)
            execMainStatus:
              type:
                - integer
                - "null"
              description: systemd exit status or signal number; null if unavailable
    HarnessLog:
      type:
        - object
        - "null"
      description: Stored redacted harness stderr artifact, or null if unavailable. Uses the combined log for older VMs. Retains at most the first 64 KiB, drops a truncated final line, and redacts recognizable credentials before storage. The object key is a storage locator, not a public or signed URL. This artifact remains available after VM deletion.
      required:
        - id
        - kind
        - object_key
        - provider
        - format
        - byte_size
        - sha256
        - state
        - created_at
      properties:
        id:
          type: string
        kind:
          type: string
          const: terminal_log
        object_key:
          type: string
        provider:
          type: string
        format:
          type: string
          const: text
        format_version:
          type:
            - string
            - "null"
        cli_version:
          type:
            - string
            - "null"
        source_generation:
          type:
            - string
            - "null"
          description: Live source generation bound to the terminal snapshot; unknown for historical receipts.
        native_session_id:
          type:
            - string
            - "null"
        byte_size:
          type:
            - integer
            - string
          description: Byte count (PostgreSQL bigint may serialize as a decimal string)
          maximum: 65536
        sha256:
          type: string
          pattern: ^[a-f0-9]{64}$
        state:
          type: string
          enum:
            - stored
        created_at:
          type: string
          format: date-time
    TraceSource:
      type: object
      required:
        - kind
        - path
        - mediaType
        - provider
      properties:
        kind:
          type: string
          enum:
            - execution_stream
            - native_session
        path:
          type: string
          description: Guest source path; historical native sources may use a discovery root
        mediaType:
          type: string
          const: application/x-ndjson
        provider:
          type: string
          enum:
            - codex
            - claude
            - pi
        formatVersion:
          type: string
        cliVersion:
          type: string
        harnessVersion:
          type: string
        discoverCommand:
          type: string
          description: Native session discovery only
    TraceSources:
      type:
        - object
        - "null"
      properties:
        primary:
          $ref: "#/components/schemas/TraceSource"
        nativeSession:
          $ref: "#/components/schemas/TraceSource"
    TraceProjection:
      type:
        - object
        - "null"
      description: Committed projection receipt. Null means no durable reconciliation evidence; it does not mean complete.
      properties:
        source_kind:
          type: string
          enum:
            - execution_stream
            - native_session
        artifact_sha256:
          type: string
        parser_version:
          type: string
        updated_at:
          type: string
          format: date-time
        reconciliation:
          type: object
          properties:
            state:
              type: string
              enum:
                - matched
                - mismatch
                - no_live_cursor
                - reprojected
            events:
              type: integer
            liveEvents:
              type: integer
            mismatches:
              type: integer
            liveOffset:
              type:
                - integer
                - "null"
            artifactBytes:
              type: integer
            generation:
              type:
                - string
                - "null"
            codexCompletion:
              type: string
              enum:
                - turn.completed
                - missing_turn_completed
              description: Completion evidence from the exact retained canonical Codex bytes.
    TraceDiagnostics:
      type: object
      required:
        - provider
        - primarySource
        - sourceVersion
        - projection
        - liveCursor
        - counts
        - artifacts
        - nativeArtifactState
        - fallbackUsed
        - lastReplay
      properties:
        provider:
          type:
            - string
            - "null"
          description: Agent trace provider; the outer diagnostics provider remains the trigger provider.
        primarySource:
          type: string
          enum:
            - execution_stream
            - native_session
        sourceVersion:
          type:
            - string
            - "null"
        projection:
          $ref: "#/components/schemas/TraceProjection"
        liveCursor:
          type:
            - object
            - "null"
          properties:
            generation:
              type: string
            committed_offset:
              type:
                - integer
                - string
            pending_bytes:
              type: integer
            updated_at:
              type: string
              format: date-time
        counts:
          type: object
          properties:
            events:
              type: integer
            parse_warnings:
              type: integer
            unknown_events:
              type: integer
            unknownEventRate:
              type: number
              minimum: 0
              maximum: 1
        artifacts:
          type: array
          description: Tenant/run-scoped receipts; storage keys are locators, never public download URLs. Includes kind, provider, source_path, source_generation, format and source/CLI/harness versions, byte size, checksum and storage state.
          items:
            type: object
        nativeArtifactState:
          type: string
          enum:
            - stored
            - missing
            - not_applicable
          description: Canonical Codex runs do not capture native sessions. Historical native receipts remain readable.
        fallbackUsed:
          type: boolean
          description: Native projection selected for a run originally declared with an execution stream primary.
        lastReplay:
          type:
            - object
            - "null"
          description: Latest completed replay request ID
          source: null
          result: null
          and timestamp; failed requests are retryable and logged.: null
    TraceReplayResult:
      type: object
      required:
        - requestId
        - runId
        - status
      properties:
        requestId:
          type: string
          format: uuid
        runId:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - projected
            - already_projected
            - skipped
            - unrecoverable
        reason:
          type: string
          enum:
            - run_active
            - ambiguous_artifacts
            - missing_artifact
            - unsupported_artifact
            - artifact_not_retained
        sourceKind:
          type: string
          enum:
            - execution_stream
            - native_session
        sha256:
          type: string
        parserVersion:
          type: string
        reconciliation:
          type: object
    RunDetail:
      allOf:
        - $ref: "#/components/schemas/Run"
      type: object
      required:
        - id
        - state
        - execution_diagnostics
        - harness_log
        - prompt
        - context
        - invocation
        - activity
        - job_name
      properties:
        id:
          type: string
        state:
          type: string
        trace_generation:
          type:
            - string
            - "null"
          description: Live file generation; clients reset trace pagination when it changes.
        trace_projection:
          $ref: "#/components/schemas/TraceProjection"
        trace_sources:
          $ref: "#/components/schemas/TraceSources"
        execution_diagnostics:
          $ref: "#/components/schemas/ExecutionDiagnostics"
        harness_log:
          $ref: "#/components/schemas/HarnessLog"
        artifact_error:
          type:
            - string
            - "null"
          description: Secondary artifact or cleanup error; does not replace execution_diagnostics
        job_name:
          type: string
          description: Current job name, included so run content does not require a separate job request.
        prompt:
          type: string
        context:
          type: object
          additionalProperties: true
        invocation:
          type: object
          required:
            - id
            - source
            - claim_key
            - trigger_id
            - context
            - occurrence
            - created_at
          properties:
            id:
              type: string
            source:
              type: string
            claim_key:
              type: string
            trigger_id:
              type:
                - string
                - "null"
            context:
              type: object
              additionalProperties: true
            occurrence:
              type:
                - object
                - "null"
              additionalProperties: true
            created_at:
              type: string
        activity:
          type: array
          items:
            type: object
            required:
              - action
              - detail
              - created_at
            properties:
              action:
                type: string
              detail:
                type: string
              created_at:
                type: string
        tenant_id:
          type: string
        invocation_id:
          type: string
        execution_handle:
          type:
            - object
            - "null"
          required:
            - backendKind
            - id
          properties:
            backendKind:
              type: string
            id:
              type: string
        execution_backend_kind:
          type: string
        execution_capabilities:
          type: array
          items:
            type: string
        claim_released:
          type: boolean
        vm_cleanup_attempt:
          type: integer
        vm_cleanup_complete:
          type: boolean
        cleanup_next_at:
          type:
            - string
            - "null"
          format: date-time
        occurrence:
          type:
            - object
            - "null"
          additionalProperties: true
        invocation_source:
          type: string
        invocation_claim_key:
          type: string
        invocation_trigger_id:
          type:
            - string
            - "null"
        invocation_created_at:
          type: string
          format: date-time
    RunDiagnostics:
      type: object
      required:
        - runId
        - jobId
        - state
        - execution
        - harnessLog
        - artifact
        - activity
      properties:
        runId:
          type: string
        jobId:
          type: string
        state:
          type: string
        provider:
          type: string
        backendKind:
          type: string
        trace:
          $ref: "#/components/schemas/TraceDiagnostics"
        traceSources:
          $ref: "#/components/schemas/TraceSources"
        execution:
          $ref: "#/components/schemas/ExecutionDiagnostics"
        harnessLog:
          $ref: "#/components/schemas/HarnessLog"
        artifact:
          type: object
          properties:
            state:
              type: string
            error:
              type:
                - string
                - "null"
              description: Secondary collection or cleanup error. Collection is retried up to three times before cleanup proceeds with partial artifacts. Cleanup failures remain retryable.
        activity:
          type: array
          items:
            type: object
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    JobInput:
      type: object
      properties:
        projectId:
          type: string
          format: uuid
          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
        name:
          type: string
          minLength: 1
          maxLength: 120
        slug:
          type: string
          pattern: ^[a-z][a-z0-9_-]{0,29}$
        promptTemplate:
          type: string
          minLength: 1
          maxLength: 50000
        runNameTemplate:
          type: string
          maxLength: 500
        concurrencyLimit:
          default: 1
          type: integer
          minimum: 1
          maximum: 50
        executionConfigId:
          type: string
          minLength: 1
        tags:
          maxItems: 20
          type: array
          items:
            type: string
            pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
        vmImage:
          type: string
          maxLength: 512
          pattern: ^(?:(?:(?:[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*\/)?[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*(?:\/[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*)*(?::[A-Za-z0-9_][A-Za-z0-9_.-]{0,127})?(?:@sha256:[a-f0-9]{64})?))?$
        model:
          type: string
          maxLength: 120
        effort:
          type: string
          maxLength: 40
        triggers:
          default: []
          maxItems: 50
          type: array
          items:
            oneOf:
              - type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  slug:
                    type: string
                    pattern: ^trigger-[1-9][0-9]*$
                  kind:
                    type: string
                    const: manual
                  enabled:
                    default: true
                    type: boolean
                  config:
                    default: {}
                    type: object
                    properties: {}
                    additionalProperties: false
                required:
                  - kind
                additionalProperties: false
              - type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  slug:
                    type: string
                    pattern: ^trigger-[1-9][0-9]*$
                  kind:
                    type: string
                    const: schedule
                  enabled:
                    default: true
                    type: boolean
                  config:
                    type: object
                    properties:
                      cron:
                        type: string
                        minLength: 1
                      timezone:
                        type: string
                        minLength: 1
                    required:
                      - cron
                      - timezone
                    additionalProperties: false
                required:
                  - kind
                  - config
                additionalProperties: false
              - type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  slug:
                    type: string
                    pattern: ^trigger-[1-9][0-9]*$
                  kind:
                    type: string
                    const: webhook
                  enabled:
                    default: true
                    type: boolean
                  config:
                    oneOf:
                      - type: object
                        properties:
                          conditions:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties: {}
                          provider:
                            type: string
                            const: linear
                          projectId:
                            type: string
                            minLength: 1
                          matchRules:
                            minItems: 1
                            type: array
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - owner
                                    - creator
                                    - status
                                    - label
                                    - assignee
                                targetId:
                                  type: string
                                  minLength: 1
                              required:
                                - type
                                - targetId
                        required:
                          - provider
                          - projectId
                          - matchRules
                        additionalProperties: false
                      - type: object
                        properties:
                          conditions:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties: {}
                          provider:
                            type: string
                            const: clickup
                          listId:
                            type: string
                            minLength: 1
                          matchRules:
                            minItems: 1
                            type: array
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - owner
                                    - creator
                                    - status
                                    - label
                                    - assignee
                                targetId:
                                  type: string
                                  minLength: 1
                              required:
                                - type
                                - targetId
                        required:
                          - provider
                          - listId
                          - matchRules
                        additionalProperties: false
                      - type: object
                        properties:
                          conditions:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties: {}
                          provider:
                            type: string
                            const: github
                          installationId:
                            type: integer
                            exclusiveMinimum: 0
                            maximum: 9007199254740991
                          repositoryId:
                            type: integer
                            exclusiveMinimum: 0
                            maximum: 9007199254740991
                          event:
                            type: string
                            minLength: 1
                          action:
                            type: string
                            minLength: 1
                          matchRules:
                            minItems: 1
                            type: array
                            items:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - owner
                                    - creator
                                    - status
                                    - label
                                    - assignee
                                targetId:
                                  type: string
                                  minLength: 1
                              required:
                                - type
                                - targetId
                        required:
                          - provider
                          - installationId
                          - repositoryId
                        additionalProperties: false
                      - type: object
                        properties:
                          conditions:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties: {}
                          provider:
                            type: string
                            const: cloudflareTail
                          integrationId:
                            type: string
                            minLength: 1
                        required:
                          - provider
                          - integrationId
                        additionalProperties: false
                required:
                  - kind
                  - config
                additionalProperties: false
              - type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  slug:
                    type: string
                    pattern: ^trigger-[1-9][0-9]*$
                  kind:
                    type: string
                    const: jobLifecycle
                  enabled:
                    default: true
                    type: boolean
                  config:
                    type: object
                    properties:
                      sourceJobIds:
                        minItems: 1
                        type: array
                        items:
                          type: string
                          minLength: 1
                      states:
                        minItems: 1
                        type: array
                        items:
                          type: string
                          enum:
                            - succeeded
                            - failed
                            - stopped
                            - edited
                    required:
                      - sourceJobIds
                      - states
                    additionalProperties: false
                required:
                  - kind
                  - config
                additionalProperties: false
              - type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  slug:
                    type: string
                    pattern: ^trigger-[1-9][0-9]*$
                  kind:
                    type: string
                    const: jobIdle
                  enabled:
                    default: true
                    type: boolean
                  config:
                    type: object
                    properties:
                      sourceJobIds:
                        minItems: 1
                        type: array
                        items:
                          type: string
                          minLength: 1
                    required:
                      - sourceJobIds
                    additionalProperties: false
                required:
                  - kind
                  - config
                additionalProperties: false
        skillIds:
          maxItems: 50
          type: array
          items:
            type: string
            format: uuid
            pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
      required:
        - name
        - slug
        - promptTemplate
        - executionConfigId
      additionalProperties: false
    ManualInvocation:
      type: object
      properties:
        prompt:
          default: ""
          type: string
          maxLength: 50000
        data:
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
        name:
          type: string
          minLength: 1
          maxLength: 120
        idempotencyKey:
          type: string
          minLength: 1
          maxLength: 200
          pattern: ^(?!manual:)
      additionalProperties: false
    JobConditionsTest:
      type: object
      properties:
        conditions:
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
        webhook:
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - webhook
      additionalProperties: false
    TraceReplayRequest:
      type: object
      properties:
        requestId:
          type: string
          format: uuid
          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          description: Tenant-scoped idempotency key; preserve it when retrying. Use a new key to reconsider a previously skipped or unrecoverable run.
        source:
          default: primary
          description: Primary replays the persisted source declaration (native for historical runs); native_session selects retained native bytes for other providers or historical native-only Codex runs. Canonical Codex runs reject native replay.
          type: string
          enum:
            - primary
            - native_session
      required:
        - requestId
      additionalProperties: false
  responses:
    Error400:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    Error401:
      description: Invalid or revoked credentials
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    Error403:
      description: Missing scope or required owner session
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    Error404:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    Error409:
      description: Operation conflict
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    Error415:
      description: Unsupported media type; use application/json
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    Error429:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    Error500:
      description: Internal error
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    Error503:
      description: Service unavailable
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
paths:
  /api/v1/auth/connections:
    post:
      summary: Persist an individual validated MCP connection; sets a per-attempt browser cookie
      description: Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached.
      responses:
        "200":
          description: Success
          headers:
            X-Factorize-Webhook-Conditions:
              description: Conditions-only webhook runtime deployment marker.
              schema:
                type: string
                const: v1
            X-Factorize-Contract:
              description: Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover.
              schema:
                type: string
                const: gen-2157-static-v1
          content:
            application/json:
              schema:
                type: object
                properties:
                  connection:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                  clientName:
                    type: string
                  expiresAt:
                    type: string
                    format: date-time
                    pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                required:
                  - connection
                  - clientName
                  - expiresAt
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: post_api_v1_auth_connections
      tags:
        - auth
      security: []
      x-browser-auth-operation: connection-start
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                returnTo:
                  type: string
                  minLength: 1
                  maxLength: 8192
              required:
                - returnTo
              additionalProperties: false
  /api/v1/auth/connections/resume:
    post:
      summary: Resume verified onboarding in the initiating browser; never grants OAuth access
      description: Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached.
      responses:
        "200":
          description: Success
          headers:
            X-Factorize-Webhook-Conditions:
              description: Conditions-only webhook runtime deployment marker.
              schema:
                type: string
                const: v1
            X-Factorize-Contract:
              description: Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover.
              schema:
                type: string
                const: gen-2157-static-v1
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: true
                  returnTo:
                    type: string
                  crossBrowser:
                    type: boolean
                  pending:
                    type: boolean
                  clientName:
                    type: string
                  expiresAt:
                    type: string
                    format: date-time
                    pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                required:
                  - ok
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: post_api_v1_auth_connections_resume
      tags:
        - auth
      security: []
      x-browser-auth-operation: connection-resume
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                connection:
                  type: string
                  format: uuid
                  pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - connection
              additionalProperties: false
  /api/v1/session:
    get:
      summary: Get current browser session
      description: Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached.
      responses:
        "200":
          description: Unauthenticated sessions return authenticated:false; expired, unverified, removed or revoked owners are unauthenticated.
          headers:
            X-Factorize-Webhook-Conditions:
              description: Conditions-only webhook runtime deployment marker.
              schema:
                type: string
                const: v1
            X-Factorize-Contract:
              description: Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover.
              schema:
                type: string
                const: gen-2157-static-v1
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      authenticated:
                        type: boolean
                        const: false
                    required:
                      - authenticated
                    additionalProperties: false
                  - type: object
                    properties:
                      authenticated:
                        type: boolean
                        const: true
                      user:
                        type: object
                        properties:
                          id:
                            type: string
                          email:
                            type: string
                            format: email
                            pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                        required:
                          - id
                          - email
                        additionalProperties: false
                      workspace:
                        type: object
                        properties:
                          id:
                            type: string
                          name:
                            type:
                              - string
                              - "null"
                          role:
                            type: string
                            const: owner
                        required:
                          - id
                          - name
                          - role
                        additionalProperties: false
                      capabilities:
                        type: array
                        items:
                          type: string
                          enum:
                            - projects:read
                            - projects:write
                            - jobs:read
                            - jobs:write
                            - runs:read
                            - runs:invoke
                            - runs:cancel
                            - runs:write
                            - integrations:read
                            - integrations:write
                            - skills:read
                            - skills:write
                      expiresAt:
                        type: string
                        format: date-time
                        pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                    required:
                      - authenticated
                      - user
                      - workspace
                      - capabilities
                      - expiresAt
                    additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: get_api_v1_session
      tags:
        - session
      security: []
      x-browser-auth-operation: session
      x-owner-session-required: false
  /api/v1/auth/login:
    post:
      summary: Sign in
      description: Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached.
      responses:
        "200":
          description: Success
          headers:
            X-Factorize-Webhook-Conditions:
              description: Conditions-only webhook runtime deployment marker.
              schema:
                type: string
                const: v1
            X-Factorize-Contract:
              description: Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover.
              schema:
                type: string
                const: gen-2157-static-v1
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: true
                  returnTo:
                    type: string
                required:
                  - ok
                  - returnTo
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: post_api_v1_auth_login
      tags:
        - auth
      security: []
      x-browser-auth-operation: login
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  maxLength: 320
                  format: email
                  pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                password:
                  type: string
                  minLength: 12
                  maxLength: 200
                  writeOnly: true
                returnTo:
                  type: string
                  maxLength: 8192
                connection:
                  type: string
                  format: uuid
                  pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - email
                - password
              additionalProperties: false
  /api/v1/auth/signup:
    post:
      summary: Request signup; existing accounts return the same accepted response
      description: Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached.
      responses:
        "202":
          description: Success
          headers:
            X-Factorize-Webhook-Conditions:
              description: Conditions-only webhook runtime deployment marker.
              schema:
                type: string
                const: v1
            X-Factorize-Contract:
              description: Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover.
              schema:
                type: string
                const: gen-2157-static-v1
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: true
                required:
                  - ok
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: post_api_v1_auth_signup
      tags:
        - auth
      security: []
      x-browser-auth-operation: signup
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  maxLength: 320
                  format: email
                  pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                password:
                  type: string
                  minLength: 12
                  maxLength: 200
                  writeOnly: true
                connection:
                  type: string
                  format: uuid
                  pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - email
                - password
              additionalProperties: false
  /api/v1/auth/email-verification/request:
    post:
      summary: Request email verification
      description: Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached.
      responses:
        "200":
          description: Success
          headers:
            X-Factorize-Webhook-Conditions:
              description: Conditions-only webhook runtime deployment marker.
              schema:
                type: string
                const: v1
            X-Factorize-Contract:
              description: Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover.
              schema:
                type: string
                const: gen-2157-static-v1
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: true
                required:
                  - ok
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: post_api_v1_auth_email_verification_request
      tags:
        - auth
      security: []
      x-browser-auth-operation: verification-request
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  maxLength: 320
                  format: email
                  pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                connection:
                  type: string
                  format: uuid
                  pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - email
              additionalProperties: false
  /api/v1/auth/email-verification/complete:
    post:
      summary: Verify email, establish an owner session, and resume explicit consent; callbacks stay in the initiating browser
      description: Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached.
      responses:
        "200":
          description: Success
          headers:
            X-Factorize-Webhook-Conditions:
              description: Conditions-only webhook runtime deployment marker.
              schema:
                type: string
                const: v1
            X-Factorize-Contract:
              description: Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover.
              schema:
                type: string
                const: gen-2157-static-v1
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: true
                  returnTo:
                    type: string
                  crossBrowser:
                    type: boolean
                  pending:
                    type: boolean
                  clientName:
                    type: string
                  expiresAt:
                    type: string
                    format: date-time
                    pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                required:
                  - ok
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: post_api_v1_auth_email_verification_complete
      tags:
        - auth
      security: []
      x-browser-auth-operation: verification
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
                  minLength: 1
                  maxLength: 512
                  writeOnly: true
              required:
                - token
              additionalProperties: false
  /api/v1/auth/password-reset/request:
    post:
      summary: Request password reset
      description: Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached.
      responses:
        "200":
          description: Success
          headers:
            X-Factorize-Webhook-Conditions:
              description: Conditions-only webhook runtime deployment marker.
              schema:
                type: string
                const: v1
            X-Factorize-Contract:
              description: Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover.
              schema:
                type: string
                const: gen-2157-static-v1
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: true
                required:
                  - ok
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: post_api_v1_auth_password_reset_request
      tags:
        - auth
      security: []
      x-browser-auth-operation: reset-request
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  maxLength: 320
                  format: email
                  pattern: ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                connection:
                  type: string
                  format: uuid
                  pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
              required:
                - email
              additionalProperties: false
  /api/v1/auth/password-reset/complete:
    post:
      summary: Complete password reset and resume onboarding
      description: Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached.
      responses:
        "200":
          description: Success
          headers:
            X-Factorize-Webhook-Conditions:
              description: Conditions-only webhook runtime deployment marker.
              schema:
                type: string
                const: v1
            X-Factorize-Contract:
              description: Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover.
              schema:
                type: string
                const: gen-2157-static-v1
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: true
                  returnTo:
                    type: string
                  crossBrowser:
                    type: boolean
                  pending:
                    type: boolean
                  clientName:
                    type: string
                  expiresAt:
                    type: string
                    format: date-time
                    pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
                required:
                  - ok
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: post_api_v1_auth_password_reset_complete
      tags:
        - auth
      security: []
      x-browser-auth-operation: reset
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
                  minLength: 1
                  maxLength: 512
                  writeOnly: true
                password:
                  type: string
                  minLength: 12
                  maxLength: 200
                  writeOnly: true
              required:
                - token
                - password
              additionalProperties: false
  /api/v1/auth/password:
    post:
      summary: Change password and invalidate sessions
      description: Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached.
      responses:
        "200":
          description: Success
          headers:
            X-Factorize-Webhook-Conditions:
              description: Conditions-only webhook runtime deployment marker.
              schema:
                type: string
                const: v1
            X-Factorize-Contract:
              description: Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover.
              schema:
                type: string
                const: gen-2157-static-v1
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: true
                required:
                  - ok
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: post_api_v1_auth_password
      tags:
        - auth
      security:
        - cookieAuth: []
      x-browser-auth-operation: password
      x-owner-session-required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                currentPassword:
                  type: string
                  minLength: 12
                  maxLength: 200
                  writeOnly: true
                password:
                  type: string
                  minLength: 12
                  maxLength: 200
                  writeOnly: true
              required:
                - currentPassword
                - password
              additionalProperties: false
  /api/v1/auth/logout:
    post:
      summary: Revoke current session and clear browser cookie
      description: Cookie-only browser operation. Mutations require an exact app Origin and reject cross-site requests. Authorization headers are rejected. Responses are never cached.
      responses:
        "200":
          description: Success
          headers:
            X-Factorize-Webhook-Conditions:
              description: Conditions-only webhook runtime deployment marker.
              schema:
                type: string
                const: v1
            X-Factorize-Contract:
              description: Deployment compatibility marker for the complete GEN-2157 static-client API contract. Deploy this API stage before static frontend cutover.
              schema:
                type: string
                const: gen-2157-static-v1
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: true
                required:
                  - ok
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: post_api_v1_auth_logout
      tags:
        - auth
      security: []
      x-browser-auth-operation: logout
      x-owner-session-required: false
  /api/v1/oauth/device/preview:
    post:
      summary: Inspect a device authorization code
      responses:
        "200":
          description: Pending device request
          content:
            application/json:
              schema:
                type: object
                properties:
                  userCode:
                    type: string
                  clientName:
                    type: string
                  scopes:
                    type: array
                    items:
                      type: string
                  expiresAt:
                    type: string
                  signature:
                    type: string
                required:
                  - userCode
                  - clientName
                  - scopes
                  - expiresAt
                  - signature
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: ""
      operationId: post_api_v1_oauth_device_preview
      tags:
        - oauth
      security:
        - cookieAuth: []
      x-browser-auth-operation: device-preview
      x-owner-session-required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userCode:
                  type: string
                  minLength: 1
                  maxLength: 32
              required:
                - userCode
              additionalProperties: false
  /api/v1/oauth/device/decision:
    post:
      summary: Approve or deny a device authorization code
      responses:
        "200":
          description: Device decision
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - approved
                      - denied
                required:
                  - status
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: ""
      operationId: post_api_v1_oauth_device_decision
      tags:
        - oauth
      security:
        - cookieAuth: []
      x-browser-auth-operation: device-decision
      x-owner-session-required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userCode:
                  type: string
                  minLength: 1
                  maxLength: 32
                signature:
                  type: string
                  minLength: 1
                  maxLength: 256
                decision:
                  type: string
                  enum:
                    - allow
                    - deny
              required:
                - userCode
                - signature
                - decision
              additionalProperties: false
  /api/v1/oauth/consent/preview:
    post:
      summary: Inspect an OAuth consent request
      responses:
        "200":
          description: Owner-bound expiring consent
          content:
            application/json:
              schema:
                type: object
                properties:
                  clientName:
                    type: string
                  scopes:
                    type: array
                    items:
                      type: string
                  request:
                    type: string
                  signature:
                    type: string
                  expiresAt:
                    type: string
                required:
                  - clientName
                  - scopes
                  - request
                  - signature
                  - expiresAt
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: ""
      operationId: post_api_v1_oauth_consent_preview
      tags:
        - oauth
      security:
        - cookieAuth: []
      x-browser-auth-operation: consent-preview
      x-owner-session-required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                authorizationQuery:
                  type: string
                  minLength: 1
                  maxLength: 8192
              required:
                - authorizationQuery
              additionalProperties: false
  /api/v1/oauth/consent/decision:
    post:
      summary: Decide an OAuth consent request
      responses:
        "200":
          description: Validated protocol destination
          content:
            application/json:
              schema:
                type: object
                properties:
                  redirectTo:
                    type: string
                required:
                  - redirectTo
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: ""
      operationId: post_api_v1_oauth_consent_decision
      tags:
        - oauth
      security:
        - cookieAuth: []
      x-browser-auth-operation: consent-decision
      x-owner-session-required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                request:
                  type: string
                  minLength: 1
                  maxLength: 16384
                signature:
                  type: string
                  minLength: 1
                  maxLength: 256
                decision:
                  type: string
                  enum:
                    - allow
                    - deny
                scopes:
                  type: array
                  items:
                    type: string
              required:
                - request
                - signature
                - decision
                - scopes
              additionalProperties: false
  /api/v1/trigger-contexts:
    get:
      summary: Get template autocomplete metadata
      responses:
        "200":
          description: Paths by trigger kind/provider
          content:
            application/json:
              schema:
                type: object
                propertyNames:
                  type: string
                additionalProperties:
                  type: array
                  items:
                    type: object
                    properties:
                      path:
                        type: string
                      type:
                        type: string
                        enum:
                          - string
                          - number
                          - boolean
                          - object
                          - array
                          - unknown
                      description:
                        type: string
                      example: {}
                    required:
                      - path
                      - type
                      - description
                    additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_trigger_contexts
      tags:
        - trigger-contexts
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:read
      x-owner-session-required: false
  /api/v1/exe-connections:
    get:
      summary: List exe connections
      responses:
        "200":
          description: Safe metadata
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    connectionId:
                      type: string
                    credentialStatus:
                      type: string
                      const: connected
                    accountTags:
                      default: []
                      type: array
                      items:
                        type: string
                    agentKind:
                      type: string
                      enum:
                        - codex
                        - claude
                        - pi
                    models:
                      default: []
                      type: array
                      items:
                        type: string
                    efforts:
                      default: []
                      type: array
                      items:
                        type: string
                  required:
                    - connectionId
                    - credentialStatus
                    - accountTags
                    - models
                    - efforts
                  additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_exe_connections
      tags:
        - exe-connections
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:read
      x-owner-session-required: false
  /api/v1/github-installations:
    get:
      summary: List GitHub installations
      responses:
        "200":
          description: Installations
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    installationId:
                      anyOf:
                        - type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        - type: string
                          pattern: ^[0-9]+$
                    accountLogin:
                      type: string
                    accountType:
                      type: string
                    state:
                      type: string
                    updatedAt:
                      type: string
                  required:
                    - installationId
                    - accountLogin
                    - accountType
                    - state
                    - updatedAt
                  additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_github_installations
      tags:
        - github-installations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:read
      x-owner-session-required: false
  /api/v1/job-trigger-availability:
    get:
      summary: List available trigger kinds
      responses:
        "200":
          description: Availability
          content:
            application/json:
              schema:
                type: object
                properties:
                  manual:
                    type: boolean
                    const: true
                  schedule:
                    type: boolean
                    const: true
                  jobLifecycle:
                    type: boolean
                    const: true
                  linear:
                    type: boolean
                  clickup:
                    type: boolean
                  github:
                    type: boolean
                  cloudflareTail:
                    type: boolean
                required:
                  - manual
                  - schedule
                  - jobLifecycle
                  - linear
                  - clickup
                  - github
                  - cloudflareTail
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_job_trigger_availability
      tags:
        - job-trigger-availability
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:read
      x-owner-session-required: false
  /api/v1/schedules/preview:
    post:
      summary: Preview schedule
      responses:
        "200":
          description: Next occurrence
          content:
            application/json:
              schema:
                type: object
                required:
                  - nextRunAt
                properties:
                  nextRunAt:
                    type: string
                    format: date-time
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_schedules_preview
      tags:
        - schedules
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:read
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                cron:
                  type: string
                  minLength: 1
                timezone:
                  type: string
                  minLength: 1
              required:
                - cron
                - timezone
              additionalProperties: false
  /api/v1/integrations/cloudflare-tail:
    get:
      summary: List Tail integrations
      responses:
        "200":
          description: Integrations
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    integrationId:
                      type: string
                    name:
                      type: string
                    status:
                      type: string
                      const: connected
                    secretConfigured:
                      type: boolean
                      const: true
                    createdAt:
                      type: string
                    updatedAt:
                      type: string
                    referencedJobCount:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                  required:
                    - integrationId
                    - name
                    - status
                    - secretConfigured
                    - referencedJobCount
                  additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_integrations_cloudflare_tail
      tags:
        - integrations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:read
      x-owner-session-required: false
    post:
      summary: Create a Tail integration
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  integrationId:
                    type: string
                  name:
                    type: string
                  status:
                    type: string
                    const: connected
                  secretConfigured:
                    type: boolean
                    const: true
                  generatedSecret:
                    type: string
                required:
                  - integrationId
                  - name
                  - status
                  - secretConfigured
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_integrations_cloudflare_tail
      tags:
        - integrations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:write
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                integrationId:
                  type: string
                  minLength: 1
                name:
                  type: string
                  minLength: 1
                  maxLength: 120
                signingSecret:
                  writeOnly: true
                  anyOf:
                    - type: string
                      const: ""
                    - type: string
                      minLength: 16
                generateSecret:
                  type: boolean
              required:
                - name
  /api/v1/integrations:
    get:
      summary: List installed integrations
      responses:
        "200":
          description: Credential-safe integration status
          content:
            application/json:
              schema:
                type: object
                properties:
                  linear:
                    anyOf:
                      - type: object
                        properties:
                          organizationName:
                            type:
                              - string
                              - "null"
                          viewerEmail:
                            type:
                              - string
                              - "null"
                        required:
                          - organizationName
                          - viewerEmail
                        additionalProperties: false
                      - type: "null"
                  clickup:
                    anyOf:
                      - type: object
                        properties:
                          teamName:
                            type:
                              - string
                              - "null"
                        required:
                          - teamName
                        additionalProperties: false
                      - type: "null"
                  exe:
                    anyOf:
                      - type: object
                        properties:
                          connectionId:
                            type: string
                          credentialStatus:
                            type: string
                            const: connected
                          accountTags:
                            default: []
                            type: array
                            items:
                              type: string
                          agentKind:
                            type: string
                            enum:
                              - codex
                              - claude
                              - pi
                          models:
                            default: []
                            type: array
                            items:
                              type: string
                          efforts:
                            default: []
                            type: array
                            items:
                              type: string
                        required:
                          - connectionId
                          - credentialStatus
                          - accountTags
                          - models
                          - efforts
                        additionalProperties: false
                      - type: "null"
                  exeConnections:
                    type: array
                    items:
                      type: object
                      properties:
                        connectionId:
                          type: string
                        credentialStatus:
                          type: string
                          const: connected
                        accountTags:
                          default: []
                          type: array
                          items:
                            type: string
                        agentKind:
                          type: string
                          enum:
                            - codex
                            - claude
                            - pi
                        models:
                          default: []
                          type: array
                          items:
                            type: string
                        efforts:
                          default: []
                          type: array
                          items:
                            type: string
                      required:
                        - connectionId
                        - credentialStatus
                        - accountTags
                        - models
                        - efforts
                      additionalProperties: false
                  ampConnections:
                    type: array
                    items:
                      type: object
                      properties:
                        connectionId:
                          type: string
                        project:
                          type: string
                        apiBaseUrl:
                          type: string
                      required:
                        - connectionId
                        - project
                      additionalProperties: false
                  cloudflareTail:
                    type: object
                    properties:
                      count:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      installations:
                        type: array
                        items:
                          type: object
                          properties:
                            integrationId:
                              type: string
                            name:
                              type: string
                            status:
                              type: string
                              const: connected
                            secretConfigured:
                              type: boolean
                              const: true
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                            referencedJobCount:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - integrationId
                            - name
                            - status
                            - secretConfigured
                            - referencedJobCount
                          additionalProperties: false
                    required:
                      - count
                      - installations
                    additionalProperties: false
                required:
                  - linear
                  - clickup
                  - exe
                  - exeConnections
                  - ampConnections
                  - cloudflareTail
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_integrations
      tags:
        - integrations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:read
      x-owner-session-required: false
  /api/v1/integrations/exe:
    put:
      summary: Create an exe.dev integration
      responses:
        "200":
          description: Saved
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  connectionId:
                    type: string
                  models:
                    type: array
                    items:
                      type: string
                required:
                  - ok
                  - connectionId
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: put_api_v1_integrations_exe
      tags:
        - integrations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:write
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                connectionId:
                  type: string
                  minLength: 1
                apiToken:
                  type: string
                  minLength: 1
                  writeOnly: true
                agentKind:
                  type: string
                  enum:
                    - codex
                    - claude
                    - pi
                tags:
                  maxItems: 20
                  type: array
                  items:
                    type: string
                    pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
  /api/v1/integrations/exe/test:
    post:
      summary: Test exe.dev credentials
      responses:
        "200":
          description: Test result
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  missingPermissions:
                    type: array
                    items:
                      type: string
                  tags:
                    type: array
                    items:
                      type: string
                  checks:
                    type: array
                    items:
                      type: object
                      properties:
                        command:
                          type: string
                        ok:
                          type: boolean
                        httpStatus:
                          type: number
                        exitCode:
                          type:
                            - number
                            - "null"
                        output:
                          type: string
                      required:
                        - command
                        - ok
                        - httpStatus
                        - exitCode
                        - output
                      additionalProperties: false
                required:
                  - ok
                  - missingPermissions
                  - tags
                  - checks
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_integrations_exe_test
      tags:
        - integrations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:write
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                connectionId:
                  type: string
                  minLength: 1
                apiToken:
                  type: string
                  minLength: 1
                  writeOnly: true
                agentKind:
                  type: string
                  enum:
                    - codex
                    - claude
                    - pi
                tags:
                  maxItems: 20
                  type: array
                  items:
                    type: string
                    pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
  /api/v1/integrations/amp:
    put:
      summary: Create an Amp integration
      responses:
        "200":
          description: Saved
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  connectionId:
                    type: string
                required:
                  - ok
                  - connectionId
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: put_api_v1_integrations_amp
      tags:
        - integrations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:write
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                connectionId:
                  type: string
                  minLength: 1
                accessToken:
                  type: string
                  minLength: 1
                  writeOnly: true
                project:
                  type: string
                  minLength: 1
                apiBaseUrl:
                  type: string
                  format: uri
  /api/v1/integrations/amp/test:
    post:
      summary: Test Amp credentials
      responses:
        "200":
          description: Test result
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                required:
                  - ok
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_integrations_amp_test
      tags:
        - integrations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:write
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                connectionId:
                  type: string
                  minLength: 1
                accessToken:
                  type: string
                  minLength: 1
                  writeOnly: true
                project:
                  type: string
                  minLength: 1
                apiBaseUrl:
                  type: string
                  format: uri
  /api/v1/providers/linear/projects:
    get:
      summary: List Linear projects
      responses:
        "200":
          description: Projects
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                  required:
                    - id
                    - name
                  additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_providers_linear_projects
      tags:
        - providers
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:read
      x-owner-session-required: false
  /api/v1/providers/linear/options:
    get:
      summary: List Linear trigger options
      responses:
        "200":
          description: Options
          content:
            application/json:
              schema:
                type: object
                properties:
                  statuses:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                      required:
                        - id
                        - name
                      additionalProperties: false
                  users:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                      required:
                        - id
                        - name
                      additionalProperties: false
                  labels:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                      required:
                        - id
                        - name
                      additionalProperties: false
                required:
                  - statuses
                  - users
                  - labels
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_providers_linear_options
      tags:
        - providers
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:read
      x-owner-session-required: false
  /api/v1/providers/clickup/lists:
    get:
      summary: List ClickUp lists
      responses:
        "200":
          description: Lists
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                  required:
                    - id
                    - name
                  additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_providers_clickup_lists
      tags:
        - providers
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:read
      x-owner-session-required: false
  /api/v1/providers/clickup/options:
    get:
      summary: List ClickUp trigger options
      responses:
        "200":
          description: Options
          content:
            application/json:
              schema:
                type: object
                properties:
                  statuses:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                      required:
                        - id
                        - name
                      additionalProperties: false
                  users:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                      required:
                        - id
                        - name
                      additionalProperties: false
                  labels:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                      required:
                        - id
                        - name
                      additionalProperties: false
                required:
                  - statuses
                  - users
                  - labels
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_providers_clickup_options
      tags:
        - providers
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:read
      x-owner-session-required: false
      parameters:
        - name: listId
          in: query
          required: false
          schema:
            default: ""
            type: string
  /api/v1/providers/github/installations:
    get:
      summary: List GitHub installations for provider setup
      responses:
        "200":
          description: Installations
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    installationId:
                      anyOf:
                        - type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        - type: string
                          pattern: ^[0-9]+$
                    accountLogin:
                      type: string
                    accountType:
                      type: string
                    state:
                      type: string
                    updatedAt:
                      type: string
                  required:
                    - installationId
                    - accountLogin
                    - accountType
                    - state
                    - updatedAt
                  additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_providers_github_installations
      tags:
        - providers
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:read
      x-owner-session-required: false
  /api/v1/access/authorized-clients:
    get:
      summary: List authorized OAuth clients
      responses:
        "200":
          description: Clients
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    grantId:
                      type: string
                    clientId:
                      type: string
                    clientName:
                      type: string
                    scopes:
                      type: array
                      items:
                        type: string
                    authorizationDate:
                      type: string
                    expiresAt:
                      type:
                        - string
                        - "null"
                    lastUsedAt:
                      type:
                        - string
                        - "null"
                  required:
                    - grantId
                    - clientId
                    - clientName
                    - scopes
                    - authorizationDate
                    - expiresAt
                    - lastUsedAt
                  additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:read scope.

        An interactive owner session is required; bearer tokens cannot call this operation.
      operationId: get_api_v1_access_authorized_clients
      tags:
        - access
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:read
      x-owner-session-required: true
  /api/v1/access-tokens:
    get:
      summary: List access tokens
      responses:
        "200":
          description: Token metadata
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                    scopes:
                      type: array
                      items:
                        type: string
                        enum:
                          - projects:read
                          - projects:write
                          - jobs:read
                          - jobs:write
                          - runs:read
                          - runs:invoke
                          - runs:cancel
                          - runs:write
                          - integrations:read
                          - integrations:write
                          - skills:read
                          - skills:write
                    created_at:
                      type: string
                    expires_at:
                      type: string
                    last_used_at:
                      type:
                        - string
                        - "null"
                    revoked_at:
                      type:
                        - string
                        - "null"
                  required:
                    - id
                    - name
                    - scopes
                    - created_at
                    - expires_at
                  additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:read scope.

        An interactive owner session is required; bearer tokens cannot call this operation.
      operationId: get_api_v1_access_tokens
      tags:
        - access-tokens
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:read
      x-owner-session-required: true
    post:
      summary: Create an access token
      responses:
        "201":
          description: Created token
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  scopes:
                    type: array
                    items:
                      type: string
                      enum:
                        - projects:read
                        - projects:write
                        - jobs:read
                        - jobs:write
                        - runs:read
                        - runs:invoke
                        - runs:cancel
                        - runs:write
                        - integrations:read
                        - integrations:write
                        - skills:read
                        - skills:write
                  created_at:
                    type: string
                  expires_at:
                    type: string
                  last_used_at:
                    type:
                      - string
                      - "null"
                  revoked_at:
                    type:
                      - string
                      - "null"
                  token:
                    type: string
                required:
                  - id
                  - name
                  - scopes
                  - created_at
                  - expires_at
                  - token
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:write scope.

        An interactive owner session is required; bearer tokens cannot call this operation.
      operationId: post_api_v1_access_tokens
      tags:
        - access-tokens
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:write
      x-owner-session-required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                scopes:
                  minItems: 1
                  type: array
                  items:
                    anyOf:
                      - type: string
                        enum:
                          - projects:read
                          - projects:write
                          - jobs:read
                          - jobs:write
                          - runs:read
                          - runs:invoke
                          - runs:cancel
                          - runs:write
                          - integrations:read
                          - integrations:write
                          - skills:read
                          - skills:write
                      - type: string
                        enum:
                          - flows:read
                          - flows:write
                expiryDays:
                  anyOf:
                    - type: number
                      const: 7
                    - type: number
                      const: 30
                    - type: number
                      const: 90
              required:
                - name
                - scopes
                - expiryDays
  /api/v1/access-tokens/{tokenId}:
    delete:
      summary: Revoke an access token
      responses:
        "200":
          description: Revoked
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:write scope.

        An interactive owner session is required; bearer tokens cannot call this operation.
      operationId: delete_api_v1_access_tokens_tokenId
      tags:
        - access-tokens
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:write
      x-owner-session-required: true
      parameters:
        - name: tokenId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/access/authorized-clients/{clientId}:
    delete:
      summary: Revoke an authorized OAuth client
      responses:
        "200":
          description: Revoked grants
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:write scope.

        An interactive owner session is required; bearer tokens cannot call this operation.
      operationId: delete_api_v1_access_authorized_clients_clientId
      tags:
        - access
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:write
      x-owner-session-required: true
      parameters:
        - name: clientId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/integrations/exe/{connectionId}:
    delete:
      summary: Remove an exe.dev integration
      responses:
        "200":
          description: Removed
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: delete_api_v1_integrations_exe_connectionId
      tags:
        - integrations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:write
      x-owner-session-required: false
      parameters:
        - name: connectionId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/integrations/amp/{connectionId}:
    delete:
      summary: Remove an Amp integration
      responses:
        "200":
          description: Removed
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: delete_api_v1_integrations_amp_connectionId
      tags:
        - integrations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:write
      x-owner-session-required: false
      parameters:
        - name: connectionId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/integrations/cloudflare-tail/{integrationId}:
    put:
      summary: Update a Tail integration
      responses:
        "200":
          description: Updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  integrationId:
                    type: string
                  name:
                    type: string
                  status:
                    type: string
                    const: connected
                  secretConfigured:
                    type: boolean
                    const: true
                  generatedSecret:
                    type: string
                required:
                  - integrationId
                  - name
                  - status
                  - secretConfigured
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: put_api_v1_integrations_cloudflare_tail_integrationId
      tags:
        - integrations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:write
      x-owner-session-required: false
      parameters:
        - name: integrationId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                integrationId:
                  type: string
                  minLength: 1
                name:
                  type: string
                  minLength: 1
                  maxLength: 120
                signingSecret:
                  writeOnly: true
                  anyOf:
                    - type: string
                      const: ""
                    - type: string
                      minLength: 16
                generateSecret:
                  type: boolean
              required:
                - name
    delete:
      summary: Remove a Tail integration
      responses:
        "200":
          description: Removed
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: delete_api_v1_integrations_cloudflare_tail_integrationId
      tags:
        - integrations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:write
      x-owner-session-required: false
      parameters:
        - name: integrationId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/integrations/cloudflare-tail/{integrationId}/test:
    post:
      summary: Test a Tail integration
      responses:
        "200":
          description: Test result
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                required:
                  - ok
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_integrations_cloudflare_tail_integrationId_test
      tags:
        - integrations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:write
      x-owner-session-required: false
      parameters:
        - name: integrationId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/providers/github/installations/{installationId}/repositories:
    get:
      summary: List installation repositories
      responses:
        "200":
          description: Repositories
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    name:
                      type: string
                    fullName:
                      type: string
                    owner:
                      type: string
                    private:
                      type: boolean
                    defaultBranch:
                      type: string
                  required:
                    - id
                    - name
                    - fullName
                    - owner
                    - private
                    - defaultBranch
                  additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_providers_github_installations_installationId_repositories
      tags:
        - providers
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:read
      x-owner-session-required: false
      parameters:
        - name: installationId
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9]+$
  /api/v1/providers/github/installations/{installationId}/repositories/{repositoryId}/issue-options:
    get:
      summary: List GitHub issue trigger options
      responses:
        "200":
          description: Options
          content:
            application/json:
              schema:
                type: object
                properties:
                  statuses:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                      required:
                        - id
                        - name
                      additionalProperties: false
                  users:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                      required:
                        - id
                        - name
                      additionalProperties: false
                  labels:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        name:
                          type: string
                      required:
                        - id
                        - name
                      additionalProperties: false
                required:
                  - statuses
                  - users
                  - labels
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_providers_github_installations_installationId_repositories_repositoryId_issue_options
      tags:
        - providers
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:read
      x-owner-session-required: false
      parameters:
        - name: installationId
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9]+$
        - name: repositoryId
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9]+$
  /api/v1/providers/github/installations/{installationId}:
    delete:
      summary: Disconnect a GitHub installation
      responses:
        "200":
          description: Disconnected
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: delete_api_v1_providers_github_installations_installationId
      tags:
        - providers
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:write
      x-owner-session-required: false
      parameters:
        - name: installationId
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9]+$
  /api/v1/integrations/exe/{connectionId}/diagnostics:
    post:
      summary: Probe exe.dev permissions and a disposable VM's agent/model integration
      responses:
        "200":
          description: Credential-safe diagnostic result
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the integrations:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_integrations_exe_connectionId_diagnostics
      tags:
        - integrations
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: integrations:write
      x-owner-session-required: false
      parameters:
        - name: connectionId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/job-summaries:
    get:
      summary: List bounded job summaries
      description: |-
        Additive list representation, ordered by immutable UUID descending. Cursor is the last ID; filters must remain the same between pages. Literal case-insensitive name/slug search. No prompts or trigger configuration; statistics are batched. Existing GET /jobs remains an array.

        Requires the jobs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      responses:
        "200":
          description: Summary page
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                        name:
                          type: string
                        slug:
                          type: string
                        enabled:
                          type: boolean
                        projectId:
                          type: string
                          format: uuid
                          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                        model:
                          type: string
                        effort:
                          type: string
                        agentKind:
                          type: string
                        concurrencyLimit:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        runningCount:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        lastRunState:
                          anyOf:
                            - type: string
                              enum:
                                - queued
                                - reserved
                                - starting
                                - running
                                - blocked
                                - stopping
                                - succeeded
                                - failed
                                - stopped
                                - done
                                - ignored
                            - type: "null"
                        createdAt:
                          type: string
                        updatedAt:
                          type: string
                      required:
                        - id
                        - name
                        - slug
                        - enabled
                        - projectId
                        - model
                        - effort
                        - agentKind
                        - concurrencyLimit
                        - runningCount
                        - lastRunState
                        - createdAt
                        - updatedAt
                      additionalProperties: false
                  nextCursor:
                    anyOf:
                      - type: string
                        format: uuid
                        pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                      - type: "null"
                required:
                  - items
                  - nextCursor
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: get_api_v1_job_summaries
      tags:
        - job-summaries
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:read
      x-owner-session-required: false
      parameters:
        - name: projectId
          in: query
          required: false
          schema:
            type: string
            format: uuid
            pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
        - name: limit
          in: query
          required: false
          schema:
            default: 30
            type: integer
            minimum: 1
            maximum: 100
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            format: uuid
            pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
        - name: q
          in: query
          required: false
          schema:
            default: ""
            type: string
            maxLength: 120
        - name: enabled
          in: query
          required: false
          schema:
            type: string
            enum:
              - "true"
              - "false"
        - name: sort
          in: query
          required: false
          schema:
            type: string
            enum:
              - id
              - updated
  /api/v1/job-selector:
    get:
      summary: Search bounded lifecycle job options
      responses:
        "200":
          description: Selector page; same ordering/filter semantics as job-summaries
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                        name:
                          type: string
                        slug:
                          type: string
                        enabled:
                          type: boolean
                      required:
                        - id
                        - name
                        - slug
                        - enabled
                      additionalProperties: false
                  nextCursor:
                    anyOf:
                      - type: string
                        format: uuid
                        pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                      - type: "null"
                required:
                  - items
                  - nextCursor
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_job_selector
      tags:
        - job-selector
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:read
      x-owner-session-required: false
      parameters:
        - name: projectId
          in: query
          required: false
          schema:
            type: string
            format: uuid
            pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
        - name: limit
          in: query
          required: false
          schema:
            default: 30
            type: integer
            minimum: 1
            maximum: 100
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            format: uuid
            pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
        - name: q
          in: query
          required: false
          schema:
            default: ""
            type: string
            maxLength: 120
        - name: enabled
          in: query
          required: false
          schema:
            type: string
            enum:
              - "true"
              - "false"
        - name: sort
          in: query
          required: false
          schema:
            type: string
            enum:
              - id
              - updated
  /api/v1/projects:
    get:
      summary: List projects
      responses:
        "200":
          description: Projects
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                      pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                    name:
                      type: string
                    description:
                      type: string
                    createdAt:
                      type: string
                    updatedAt:
                      type: string
                    jobCount:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                  required:
                    - id
                    - name
                    - createdAt
                    - updatedAt
                    - jobCount
                  additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the projects:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_projects
      tags:
        - projects
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: projects:read
      x-owner-session-required: false
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            default: 100
            type: integer
            minimum: 1
            maximum: 100
        - name: sort
          in: query
          required: false
          schema:
            default: name
            type: string
            enum:
              - name
              - updated
    post:
      summary: Create project
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  name:
                    type: string
                  description:
                    type: string
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                  jobCount:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                required:
                  - id
                  - name
                  - createdAt
                  - updatedAt
                  - jobCount
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the projects:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_projects
      tags:
        - projects
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: projects:write
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 120
                description:
                  type: string
                  maxLength: 2000
              required:
                - name
              additionalProperties: false
  /api/v1/projects/{projectId}:
    get:
      summary: Get project
      responses:
        "200":
          description: Project
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  name:
                    type: string
                  description:
                    type: string
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                  jobCount:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                required:
                  - id
                  - name
                  - createdAt
                  - updatedAt
                  - jobCount
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the projects:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_projects_projectId
      tags:
        - projects
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: projects:read
      x-owner-session-required: false
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
    put:
      summary: Update project
      responses:
        "200":
          description: Updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  name:
                    type: string
                  description:
                    type: string
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                  jobCount:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                required:
                  - id
                  - name
                  - createdAt
                  - updatedAt
                  - jobCount
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the projects:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: put_api_v1_projects_projectId
      tags:
        - projects
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: projects:write
      x-owner-session-required: false
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 120
                description:
                  type: string
                  maxLength: 2000
              required:
                - name
              additionalProperties: false
    delete:
      summary: Delete empty project
      responses:
        "200":
          description: Deleted
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the projects:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: delete_api_v1_projects_projectId
      tags:
        - projects
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: projects:write
      x-owner-session-required: false
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/skills:
    get:
      summary: Search global skills
      responses:
        "200":
          description: Skills
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                        key:
                          type: string
                        revision:
                          type: integer
                          exclusiveMinimum: 0
                          maximum: 9007199254740991
                        usageCount:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                        createdAt:
                          type: string
                        updatedAt:
                          type: string
                      required:
                        - id
                        - key
                        - revision
                        - usageCount
                        - createdAt
                        - updatedAt
                      additionalProperties: false
                  nextCursor:
                    anyOf:
                      - type: string
                        format: uuid
                        pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                      - type: "null"
                required:
                  - items
                  - nextCursor
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the skills:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_skills
      tags:
        - skills
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: skills:read
      x-owner-session-required: false
      parameters:
        - name: q
          in: query
          required: false
          schema:
            default: ""
            type: string
        - name: limit
          in: query
          required: false
          schema:
            default: 30
            type: integer
            minimum: 1
            maximum: 100
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            format: uuid
            pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
    post:
      summary: Create a global skill
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  key:
                    type: string
                  revision:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                  body:
                    type: string
                  usageCount:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                required:
                  - id
                  - key
                  - revision
                  - body
                  - usageCount
                  - createdAt
                  - updatedAt
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the skills:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_skills
      tags:
        - skills
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: skills:write
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                key:
                  type: string
                  pattern: ^[a-z][a-z0-9_-]{0,63}$
                body:
                  type: string
                  maxLength: 100000
              required:
                - key
                - body
              additionalProperties: false
  /api/v1/skills/preview:
    post:
      summary: Preview a composed job prompt
      responses:
        "200":
          description: Prompt preview
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the skills:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_skills_preview
      tags:
        - skills
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: skills:read
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                skillIds:
                  maxItems: 50
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                jobContext:
                  type: string
                  maxLength: 50000
                sampleTriggerData:
                  type: object
                  propertyNames:
                    type: string
                  additionalProperties: {}
              required:
                - skillIds
                - jobContext
              additionalProperties: false
  /api/v1/skills/{skillId}:
    get:
      summary: Get a global skill
      responses:
        "200":
          description: Skill
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  key:
                    type: string
                  revision:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                  body:
                    type: string
                  usageCount:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                required:
                  - id
                  - key
                  - revision
                  - body
                  - usageCount
                  - createdAt
                  - updatedAt
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the skills:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_skills_skillId
      tags:
        - skills
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: skills:read
      x-owner-session-required: false
      parameters:
        - name: skillId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
    put:
      summary: Update a global skill
      responses:
        "200":
          description: Updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  key:
                    type: string
                  revision:
                    type: integer
                    exclusiveMinimum: 0
                    maximum: 9007199254740991
                  body:
                    type: string
                  usageCount:
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                required:
                  - id
                  - key
                  - revision
                  - body
                  - usageCount
                  - createdAt
                  - updatedAt
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the skills:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: put_api_v1_skills_skillId
      tags:
        - skills
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: skills:write
      x-owner-session-required: false
      parameters:
        - name: skillId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                key:
                  type: string
                  pattern: ^[a-z][a-z0-9_-]{0,63}$
                body:
                  type: string
                  maxLength: 100000
                expectedRevision:
                  type: integer
                  exclusiveMinimum: 0
                  maximum: 9007199254740991
              required:
                - expectedRevision
              additionalProperties: false
    delete:
      summary: Delete an unused global skill
      responses:
        "200":
          description: Deleted
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the skills:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: delete_api_v1_skills_skillId
      tags:
        - skills
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: skills:write
      x-owner-session-required: false
      parameters:
        - name: skillId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
        - name: expectedRevision
          in: query
          required: true
          schema:
            type: integer
            exclusiveMinimum: 0
            maximum: 9007199254740991
  /api/v1/skills/{skillId}/jobs:
    get:
      summary: List jobs using a skill
      responses:
        "200":
          description: Jobs
          content:
            application/json:
              schema:
                type: object
                properties:
                  skillId:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  jobs:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                        name:
                          type: string
                        slug:
                          type: string
                        enabled:
                          type: boolean
                        projectId:
                          type: string
                          format: uuid
                          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                      required:
                        - id
                        - name
                        - slug
                        - enabled
                        - projectId
                      additionalProperties: false
                required:
                  - skillId
                  - jobs
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the skills:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_skills_skillId_jobs
      tags:
        - skills
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: skills:read
      x-owner-session-required: false
      parameters:
        - name: skillId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/jobs/{jobId}/project:
    post:
      summary: Move a job to a project
      responses:
        "200":
          description: Moved
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  projectId:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  name:
                    type: string
                  slug:
                    type: string
                  enabled:
                    type: boolean
                  promptTemplate:
                    type: string
                  runNameTemplate:
                    type: string
                  tags:
                    type: array
                    items:
                      type: string
                  model:
                    type: string
                  effort:
                    type: string
                  executionConfig:
                    type: object
                    properties:
                      connectionId:
                        type: string
                      workspace:
                        type: string
                      cwd:
                        type: string
                      agentKind:
                        type: string
                      image:
                        type: string
                    required:
                      - connectionId
                      - agentKind
                    additionalProperties: false
                  executionConfigId:
                    type: string
                  agentKind:
                    type: string
                  concurrencyLimit:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  runningCount:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  currentRuns:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  maxConcurrency:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  lastRunState:
                    anyOf:
                      - type: string
                        enum:
                          - queued
                          - reserved
                          - starting
                          - running
                          - blocked
                          - stopping
                          - succeeded
                          - failed
                          - stopped
                          - done
                          - ignored
                      - type: "null"
                  triggers:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: manual
                            enabled:
                              default: true
                              type: boolean
                            config:
                              default: {}
                              type: object
                              properties: {}
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: schedule
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                cron:
                                  type: string
                                  minLength: 1
                                timezone:
                                  type: string
                                  minLength: 1
                              required:
                                - cron
                                - timezone
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: webhook
                            enabled:
                              default: true
                              type: boolean
                            config:
                              oneOf:
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: linear
                                    projectId:
                                      type: string
                                      minLength: 1
                                    matchRules:
                                      minItems: 1
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - owner
                                              - creator
                                              - status
                                              - label
                                              - assignee
                                          targetId:
                                            type: string
                                            minLength: 1
                                        required:
                                          - type
                                          - targetId
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - projectId
                                    - matchRules
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: clickup
                                    listId:
                                      type: string
                                      minLength: 1
                                    matchRules:
                                      minItems: 1
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - owner
                                              - creator
                                              - status
                                              - label
                                              - assignee
                                          targetId:
                                            type: string
                                            minLength: 1
                                        required:
                                          - type
                                          - targetId
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - listId
                                    - matchRules
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: github
                                    installationId:
                                      type: integer
                                      exclusiveMinimum: 0
                                      maximum: 9007199254740991
                                    repositoryId:
                                      type: integer
                                      exclusiveMinimum: 0
                                      maximum: 9007199254740991
                                    event:
                                      type: string
                                      minLength: 1
                                    action:
                                      type: string
                                      minLength: 1
                                    matchRules:
                                      minItems: 1
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - owner
                                              - creator
                                              - status
                                              - label
                                              - assignee
                                          targetId:
                                            type: string
                                            minLength: 1
                                        required:
                                          - type
                                          - targetId
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - installationId
                                    - repositoryId
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: cloudflareTail
                                    integrationId:
                                      type: string
                                      minLength: 1
                                    destination:
                                      type: string
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - integrationId
                                  additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: jobLifecycle
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                sourceJobIds:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                                states:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    enum:
                                      - succeeded
                                      - failed
                                      - stopped
                                      - edited
                              required:
                                - sourceJobIds
                                - states
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: jobIdle
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                sourceJobIds:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                              required:
                                - sourceJobIds
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                  skills:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                        key:
                          type: string
                        revision:
                          type: integer
                          exclusiveMinimum: 0
                          maximum: 9007199254740991
                        position:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                      required:
                        - id
                        - key
                        - revision
                        - position
                      additionalProperties: false
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                required:
                  - id
                  - name
                  - slug
                  - enabled
                  - promptTemplate
                  - runNameTemplate
                  - model
                  - executionConfig
                  - executionConfigId
                  - agentKind
                  - concurrencyLimit
                  - runningCount
                  - currentRuns
                  - maxConcurrency
                  - lastRunState
                  - triggers
                  - createdAt
                  - updatedAt
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the projects:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_jobs_jobId_project
      tags:
        - jobs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: projects:write
      x-owner-session-required: false
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                projectId:
                  type: string
                  format: uuid
                  pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                expectedUpdatedAt:
                  type: string
                  format: date-time
                  pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
              required:
                - projectId
  /api/v1/vm-image-verifications:
    post:
      summary: Verify a public VM image
      description: |-
        Starts a tenant-scoped background verification. It creates a temporary Factorize-owned VM, checks SSH and the selected harness prerequisites, then deletes the VM. It never executes a job prompt.

        Requires the jobs:write scope.

        Accepts a scoped bearer token or interactive owner session.
      responses:
        "200":
          description: Verification operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  status:
                    type: string
                    enum:
                      - queued
                      - creating
                      - checking_ssh
                      - checking_agent
                      - cleaning_up
                      - succeeded
                      - failed
                      - cleanup_failed
                  phase:
                    type: string
                  errorKind:
                    type:
                      - string
                      - "null"
                  error:
                    type:
                      - string
                      - "null"
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                required:
                  - id
                  - status
                  - phase
                  - errorKind
                  - error
                  - createdAt
                  - updatedAt
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: post_api_v1_vm_image_verifications
      tags:
        - vm-image-verifications
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:write
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                connectionId:
                  type: string
                  minLength: 1
                  maxLength: 200
                image:
                  type: string
                  minLength: 1
                  maxLength: 512
                  pattern: ^(?:(?:[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*\/)?[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*(?:\/[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*)*(?::[A-Za-z0-9_][A-Za-z0-9_.-]{0,127})?(?:@sha256:[a-f0-9]{64})?)$
                tags:
                  maxItems: 20
                  type: array
                  items:
                    type: string
                    pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
                agentKind:
                  type: string
                  enum:
                    - codex
                    - claude
                    - pi
              required:
                - connectionId
                - image
                - tags
                - agentKind
              additionalProperties: false
  /api/v1/vm-image-verifications/{verificationId}:
    get:
      summary: Get VM image verification progress
      responses:
        "200":
          description: Verification operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  status:
                    type: string
                    enum:
                      - queued
                      - creating
                      - checking_ssh
                      - checking_agent
                      - cleaning_up
                      - succeeded
                      - failed
                      - cleanup_failed
                  phase:
                    type: string
                  errorKind:
                    type:
                      - string
                      - "null"
                  error:
                    type:
                      - string
                      - "null"
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                required:
                  - id
                  - status
                  - phase
                  - errorKind
                  - error
                  - createdAt
                  - updatedAt
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_vm_image_verifications_verificationId
      tags:
        - vm-image-verifications
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:read
      x-owner-session-required: false
      parameters:
        - name: verificationId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/jobs:
    get:
      summary: List jobs
      responses:
        "200":
          description: Jobs
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                      pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                    projectId:
                      type: string
                      format: uuid
                      pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                    name:
                      type: string
                    slug:
                      type: string
                    enabled:
                      type: boolean
                    promptTemplate:
                      type: string
                    runNameTemplate:
                      type: string
                    tags:
                      type: array
                      items:
                        type: string
                    model:
                      type: string
                    effort:
                      type: string
                    executionConfig:
                      type: object
                      properties:
                        connectionId:
                          type: string
                        workspace:
                          type: string
                        cwd:
                          type: string
                        agentKind:
                          type: string
                        image:
                          type: string
                      required:
                        - connectionId
                        - agentKind
                      additionalProperties: false
                    executionConfigId:
                      type: string
                    agentKind:
                      type: string
                    concurrencyLimit:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    runningCount:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    currentRuns:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    maxConcurrency:
                      type: integer
                      minimum: -9007199254740991
                      maximum: 9007199254740991
                    lastRunState:
                      anyOf:
                        - type: string
                          enum:
                            - queued
                            - reserved
                            - starting
                            - running
                            - blocked
                            - stopping
                            - succeeded
                            - failed
                            - stopped
                            - done
                            - ignored
                        - type: "null"
                    triggers:
                      type: array
                      items:
                        oneOf:
                          - type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                                pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                              slug:
                                type: string
                              kind:
                                type: string
                                const: manual
                              enabled:
                                default: true
                                type: boolean
                              config:
                                default: {}
                                type: object
                                properties: {}
                                additionalProperties: false
                              jobId:
                                type: string
                                format: uuid
                                pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                              createdAt:
                                type: string
                              updatedAt:
                                type: string
                            required:
                              - id
                              - slug
                              - kind
                              - enabled
                              - config
                              - jobId
                              - createdAt
                              - updatedAt
                            additionalProperties: false
                          - type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                                pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                              slug:
                                type: string
                              kind:
                                type: string
                                const: schedule
                              enabled:
                                default: true
                                type: boolean
                              config:
                                type: object
                                properties:
                                  cron:
                                    type: string
                                    minLength: 1
                                  timezone:
                                    type: string
                                    minLength: 1
                                required:
                                  - cron
                                  - timezone
                                additionalProperties: false
                              jobId:
                                type: string
                                format: uuid
                                pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                              createdAt:
                                type: string
                              updatedAt:
                                type: string
                            required:
                              - id
                              - slug
                              - kind
                              - enabled
                              - config
                              - jobId
                              - createdAt
                              - updatedAt
                            additionalProperties: false
                          - type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                                pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                              slug:
                                type: string
                              kind:
                                type: string
                                const: webhook
                              enabled:
                                default: true
                                type: boolean
                              config:
                                oneOf:
                                  - type: object
                                    properties:
                                      conditions:
                                        type: object
                                        propertyNames:
                                          type: string
                                        additionalProperties: {}
                                      provider:
                                        type: string
                                        const: linear
                                      projectId:
                                        type: string
                                        minLength: 1
                                      matchRules:
                                        minItems: 1
                                        type: array
                                        items:
                                          type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - owner
                                                - creator
                                                - status
                                                - label
                                                - assignee
                                            targetId:
                                              type: string
                                              minLength: 1
                                          required:
                                            - type
                                            - targetId
                                          additionalProperties: false
                                      secretConfigured:
                                        type: boolean
                                    required:
                                      - provider
                                      - projectId
                                      - matchRules
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      conditions:
                                        type: object
                                        propertyNames:
                                          type: string
                                        additionalProperties: {}
                                      provider:
                                        type: string
                                        const: clickup
                                      listId:
                                        type: string
                                        minLength: 1
                                      matchRules:
                                        minItems: 1
                                        type: array
                                        items:
                                          type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - owner
                                                - creator
                                                - status
                                                - label
                                                - assignee
                                            targetId:
                                              type: string
                                              minLength: 1
                                          required:
                                            - type
                                            - targetId
                                          additionalProperties: false
                                      secretConfigured:
                                        type: boolean
                                    required:
                                      - provider
                                      - listId
                                      - matchRules
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      conditions:
                                        type: object
                                        propertyNames:
                                          type: string
                                        additionalProperties: {}
                                      provider:
                                        type: string
                                        const: github
                                      installationId:
                                        type: integer
                                        exclusiveMinimum: 0
                                        maximum: 9007199254740991
                                      repositoryId:
                                        type: integer
                                        exclusiveMinimum: 0
                                        maximum: 9007199254740991
                                      event:
                                        type: string
                                        minLength: 1
                                      action:
                                        type: string
                                        minLength: 1
                                      matchRules:
                                        minItems: 1
                                        type: array
                                        items:
                                          type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - owner
                                                - creator
                                                - status
                                                - label
                                                - assignee
                                            targetId:
                                              type: string
                                              minLength: 1
                                          required:
                                            - type
                                            - targetId
                                          additionalProperties: false
                                      secretConfigured:
                                        type: boolean
                                    required:
                                      - provider
                                      - installationId
                                      - repositoryId
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      conditions:
                                        type: object
                                        propertyNames:
                                          type: string
                                        additionalProperties: {}
                                      provider:
                                        type: string
                                        const: cloudflareTail
                                      integrationId:
                                        type: string
                                        minLength: 1
                                      destination:
                                        type: string
                                      secretConfigured:
                                        type: boolean
                                    required:
                                      - provider
                                      - integrationId
                                    additionalProperties: false
                              jobId:
                                type: string
                                format: uuid
                                pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                              createdAt:
                                type: string
                              updatedAt:
                                type: string
                            required:
                              - id
                              - slug
                              - kind
                              - enabled
                              - config
                              - jobId
                              - createdAt
                              - updatedAt
                            additionalProperties: false
                          - type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                                pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                              slug:
                                type: string
                              kind:
                                type: string
                                const: jobLifecycle
                              enabled:
                                default: true
                                type: boolean
                              config:
                                type: object
                                properties:
                                  sourceJobIds:
                                    minItems: 1
                                    type: array
                                    items:
                                      type: string
                                      minLength: 1
                                  states:
                                    minItems: 1
                                    type: array
                                    items:
                                      type: string
                                      enum:
                                        - succeeded
                                        - failed
                                        - stopped
                                        - edited
                                required:
                                  - sourceJobIds
                                  - states
                                additionalProperties: false
                              jobId:
                                type: string
                                format: uuid
                                pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                              createdAt:
                                type: string
                              updatedAt:
                                type: string
                            required:
                              - id
                              - slug
                              - kind
                              - enabled
                              - config
                              - jobId
                              - createdAt
                              - updatedAt
                            additionalProperties: false
                          - type: object
                            properties:
                              id:
                                type: string
                                format: uuid
                                pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                              slug:
                                type: string
                              kind:
                                type: string
                                const: jobIdle
                              enabled:
                                default: true
                                type: boolean
                              config:
                                type: object
                                properties:
                                  sourceJobIds:
                                    minItems: 1
                                    type: array
                                    items:
                                      type: string
                                      minLength: 1
                                required:
                                  - sourceJobIds
                                additionalProperties: false
                              jobId:
                                type: string
                                format: uuid
                                pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                              createdAt:
                                type: string
                              updatedAt:
                                type: string
                            required:
                              - id
                              - slug
                              - kind
                              - enabled
                              - config
                              - jobId
                              - createdAt
                              - updatedAt
                            additionalProperties: false
                    skills:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                            pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                          key:
                            type: string
                          revision:
                            type: integer
                            exclusiveMinimum: 0
                            maximum: 9007199254740991
                          position:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                        required:
                          - id
                          - key
                          - revision
                          - position
                        additionalProperties: false
                    createdAt:
                      type: string
                    updatedAt:
                      type: string
                  required:
                    - id
                    - name
                    - slug
                    - enabled
                    - promptTemplate
                    - runNameTemplate
                    - model
                    - executionConfig
                    - executionConfigId
                    - agentKind
                    - concurrencyLimit
                    - runningCount
                    - currentRuns
                    - maxConcurrency
                    - lastRunState
                    - triggers
                    - createdAt
                    - updatedAt
                  additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_jobs
      tags:
        - jobs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:read
      x-owner-session-required: false
    post:
      summary: Create job
      responses:
        "201":
          description: Created
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  projectId:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  name:
                    type: string
                  slug:
                    type: string
                  enabled:
                    type: boolean
                  promptTemplate:
                    type: string
                  runNameTemplate:
                    type: string
                  tags:
                    type: array
                    items:
                      type: string
                  model:
                    type: string
                  effort:
                    type: string
                  executionConfig:
                    type: object
                    properties:
                      connectionId:
                        type: string
                      workspace:
                        type: string
                      cwd:
                        type: string
                      agentKind:
                        type: string
                      image:
                        type: string
                    required:
                      - connectionId
                      - agentKind
                    additionalProperties: false
                  executionConfigId:
                    type: string
                  agentKind:
                    type: string
                  concurrencyLimit:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  runningCount:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  currentRuns:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  maxConcurrency:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  lastRunState:
                    anyOf:
                      - type: string
                        enum:
                          - queued
                          - reserved
                          - starting
                          - running
                          - blocked
                          - stopping
                          - succeeded
                          - failed
                          - stopped
                          - done
                          - ignored
                      - type: "null"
                  triggers:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: manual
                            enabled:
                              default: true
                              type: boolean
                            config:
                              default: {}
                              type: object
                              properties: {}
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: schedule
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                cron:
                                  type: string
                                  minLength: 1
                                timezone:
                                  type: string
                                  minLength: 1
                              required:
                                - cron
                                - timezone
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: webhook
                            enabled:
                              default: true
                              type: boolean
                            config:
                              oneOf:
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: linear
                                    projectId:
                                      type: string
                                      minLength: 1
                                    matchRules:
                                      minItems: 1
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - owner
                                              - creator
                                              - status
                                              - label
                                              - assignee
                                          targetId:
                                            type: string
                                            minLength: 1
                                        required:
                                          - type
                                          - targetId
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - projectId
                                    - matchRules
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: clickup
                                    listId:
                                      type: string
                                      minLength: 1
                                    matchRules:
                                      minItems: 1
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - owner
                                              - creator
                                              - status
                                              - label
                                              - assignee
                                          targetId:
                                            type: string
                                            minLength: 1
                                        required:
                                          - type
                                          - targetId
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - listId
                                    - matchRules
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: github
                                    installationId:
                                      type: integer
                                      exclusiveMinimum: 0
                                      maximum: 9007199254740991
                                    repositoryId:
                                      type: integer
                                      exclusiveMinimum: 0
                                      maximum: 9007199254740991
                                    event:
                                      type: string
                                      minLength: 1
                                    action:
                                      type: string
                                      minLength: 1
                                    matchRules:
                                      minItems: 1
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - owner
                                              - creator
                                              - status
                                              - label
                                              - assignee
                                          targetId:
                                            type: string
                                            minLength: 1
                                        required:
                                          - type
                                          - targetId
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - installationId
                                    - repositoryId
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: cloudflareTail
                                    integrationId:
                                      type: string
                                      minLength: 1
                                    destination:
                                      type: string
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - integrationId
                                  additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: jobLifecycle
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                sourceJobIds:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                                states:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    enum:
                                      - succeeded
                                      - failed
                                      - stopped
                                      - edited
                              required:
                                - sourceJobIds
                                - states
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: jobIdle
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                sourceJobIds:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                              required:
                                - sourceJobIds
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                  skills:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                        key:
                          type: string
                        revision:
                          type: integer
                          exclusiveMinimum: 0
                          maximum: 9007199254740991
                        position:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                      required:
                        - id
                        - key
                        - revision
                        - position
                      additionalProperties: false
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                required:
                  - id
                  - name
                  - slug
                  - enabled
                  - promptTemplate
                  - runNameTemplate
                  - model
                  - executionConfig
                  - executionConfigId
                  - agentKind
                  - concurrencyLimit
                  - runningCount
                  - currentRuns
                  - maxConcurrency
                  - lastRunState
                  - triggers
                  - createdAt
                  - updatedAt
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_jobs
      tags:
        - jobs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:write
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/JobInput"
  /api/v1/job-conditions/test:
    post:
      summary: Test webhook conditions
      description: |-
        Evaluates supplied prepared webhook context only; does not authenticate the example, route events, verify GitHub state, or invoke jobs.

        Requires the jobs:write scope.

        Accepts a scoped bearer token or interactive owner session.
      responses:
        "200":
          description: Decision
          content:
            application/json:
              schema:
                type: object
                properties:
                  decision:
                    type: string
                    enum:
                      - match
                      - no-match
                      - error
                  error:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
                      propertyNames:
                        type: string
                      additionalProperties: {}
                required:
                  - decision
                  - details
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: post_api_v1_job_conditions_test
      tags:
        - job-conditions
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:write
      x-owner-session-required: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/JobConditionsTest"
  /api/v1/jobs/{jobId}/invocations:
    post:
      summary: Invoke job
      responses:
        "202":
          description: Accepted
          content:
            application/json:
              schema:
                type: object
                required:
                  - invocationId
                  - runId
                  - state
                  - duplicate
                properties:
                  invocationId:
                    type: string
                  runId:
                    type: string
                  state:
                    type: string
                  duplicate:
                    type: boolean
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
          description: queue_full — all execution slots are reserved or occupied and one waiting run already exists. Duplicate idempotency keys return the original run.
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the runs:invoke scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_jobs_jobId_invocations
      tags:
        - jobs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:invoke
      x-owner-session-required: false
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ManualInvocation"
  /api/v1/jobs/{jobId}/events:
    get:
      summary: List webhook activity
      responses:
        "200":
          description: Activity
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the runs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_jobs_jobId_events
      tags:
        - jobs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:read
      x-owner-session-required: false
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
        - name: limit
          in: query
          required: false
          schema:
            default: 50
            type: integer
            minimum: 1
            maximum: 100
  /api/v1/jobs/{jobId}/enable:
    post:
      summary: Enable job
      responses:
        "200":
          description: Enabled
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_jobs_jobId_enable
      tags:
        - jobs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:write
      x-owner-session-required: false
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/jobs/{jobId}/disable:
    post:
      summary: Disable job
      responses:
        "200":
          description: Disabled
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_jobs_jobId_disable
      tags:
        - jobs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:write
      x-owner-session-required: false
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/jobs/{jobId}:
    get:
      summary: Get job
      responses:
        "200":
          description: Job
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  projectId:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  name:
                    type: string
                  slug:
                    type: string
                  enabled:
                    type: boolean
                  promptTemplate:
                    type: string
                  runNameTemplate:
                    type: string
                  tags:
                    type: array
                    items:
                      type: string
                  model:
                    type: string
                  effort:
                    type: string
                  executionConfig:
                    type: object
                    properties:
                      connectionId:
                        type: string
                      workspace:
                        type: string
                      cwd:
                        type: string
                      agentKind:
                        type: string
                      image:
                        type: string
                    required:
                      - connectionId
                      - agentKind
                    additionalProperties: false
                  executionConfigId:
                    type: string
                  agentKind:
                    type: string
                  concurrencyLimit:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  runningCount:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  currentRuns:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  maxConcurrency:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  lastRunState:
                    anyOf:
                      - type: string
                        enum:
                          - queued
                          - reserved
                          - starting
                          - running
                          - blocked
                          - stopping
                          - succeeded
                          - failed
                          - stopped
                          - done
                          - ignored
                      - type: "null"
                  triggers:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: manual
                            enabled:
                              default: true
                              type: boolean
                            config:
                              default: {}
                              type: object
                              properties: {}
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: schedule
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                cron:
                                  type: string
                                  minLength: 1
                                timezone:
                                  type: string
                                  minLength: 1
                              required:
                                - cron
                                - timezone
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: webhook
                            enabled:
                              default: true
                              type: boolean
                            config:
                              oneOf:
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: linear
                                    projectId:
                                      type: string
                                      minLength: 1
                                    matchRules:
                                      minItems: 1
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - owner
                                              - creator
                                              - status
                                              - label
                                              - assignee
                                          targetId:
                                            type: string
                                            minLength: 1
                                        required:
                                          - type
                                          - targetId
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - projectId
                                    - matchRules
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: clickup
                                    listId:
                                      type: string
                                      minLength: 1
                                    matchRules:
                                      minItems: 1
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - owner
                                              - creator
                                              - status
                                              - label
                                              - assignee
                                          targetId:
                                            type: string
                                            minLength: 1
                                        required:
                                          - type
                                          - targetId
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - listId
                                    - matchRules
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: github
                                    installationId:
                                      type: integer
                                      exclusiveMinimum: 0
                                      maximum: 9007199254740991
                                    repositoryId:
                                      type: integer
                                      exclusiveMinimum: 0
                                      maximum: 9007199254740991
                                    event:
                                      type: string
                                      minLength: 1
                                    action:
                                      type: string
                                      minLength: 1
                                    matchRules:
                                      minItems: 1
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - owner
                                              - creator
                                              - status
                                              - label
                                              - assignee
                                          targetId:
                                            type: string
                                            minLength: 1
                                        required:
                                          - type
                                          - targetId
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - installationId
                                    - repositoryId
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: cloudflareTail
                                    integrationId:
                                      type: string
                                      minLength: 1
                                    destination:
                                      type: string
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - integrationId
                                  additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: jobLifecycle
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                sourceJobIds:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                                states:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    enum:
                                      - succeeded
                                      - failed
                                      - stopped
                                      - edited
                              required:
                                - sourceJobIds
                                - states
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: jobIdle
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                sourceJobIds:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                              required:
                                - sourceJobIds
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                  skills:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                        key:
                          type: string
                        revision:
                          type: integer
                          exclusiveMinimum: 0
                          maximum: 9007199254740991
                        position:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                      required:
                        - id
                        - key
                        - revision
                        - position
                      additionalProperties: false
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                required:
                  - id
                  - name
                  - slug
                  - enabled
                  - promptTemplate
                  - runNameTemplate
                  - model
                  - executionConfig
                  - executionConfigId
                  - agentKind
                  - concurrencyLimit
                  - runningCount
                  - currentRuns
                  - maxConcurrency
                  - lastRunState
                  - triggers
                  - createdAt
                  - updatedAt
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_jobs_jobId
      tags:
        - jobs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:read
      x-owner-session-required: false
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
    put:
      summary: Replace job
      description: |-
        Supply expectedUpdatedAt from GET for atomic optimistic concurrency. Stale edits return 409 stale_job. Omission preserves legacy REST/MCP last-writer-wins updates. Trigger identity is preserved.

        Requires the jobs:write scope.

        Accepts a scoped bearer token or interactive owner session.
      responses:
        "200":
          description: Updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  projectId:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                  name:
                    type: string
                  slug:
                    type: string
                  enabled:
                    type: boolean
                  promptTemplate:
                    type: string
                  runNameTemplate:
                    type: string
                  tags:
                    type: array
                    items:
                      type: string
                  model:
                    type: string
                  effort:
                    type: string
                  executionConfig:
                    type: object
                    properties:
                      connectionId:
                        type: string
                      workspace:
                        type: string
                      cwd:
                        type: string
                      agentKind:
                        type: string
                      image:
                        type: string
                    required:
                      - connectionId
                      - agentKind
                    additionalProperties: false
                  executionConfigId:
                    type: string
                  agentKind:
                    type: string
                  concurrencyLimit:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  runningCount:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  currentRuns:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  maxConcurrency:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  lastRunState:
                    anyOf:
                      - type: string
                        enum:
                          - queued
                          - reserved
                          - starting
                          - running
                          - blocked
                          - stopping
                          - succeeded
                          - failed
                          - stopped
                          - done
                          - ignored
                      - type: "null"
                  triggers:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: manual
                            enabled:
                              default: true
                              type: boolean
                            config:
                              default: {}
                              type: object
                              properties: {}
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: schedule
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                cron:
                                  type: string
                                  minLength: 1
                                timezone:
                                  type: string
                                  minLength: 1
                              required:
                                - cron
                                - timezone
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: webhook
                            enabled:
                              default: true
                              type: boolean
                            config:
                              oneOf:
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: linear
                                    projectId:
                                      type: string
                                      minLength: 1
                                    matchRules:
                                      minItems: 1
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - owner
                                              - creator
                                              - status
                                              - label
                                              - assignee
                                          targetId:
                                            type: string
                                            minLength: 1
                                        required:
                                          - type
                                          - targetId
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - projectId
                                    - matchRules
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: clickup
                                    listId:
                                      type: string
                                      minLength: 1
                                    matchRules:
                                      minItems: 1
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - owner
                                              - creator
                                              - status
                                              - label
                                              - assignee
                                          targetId:
                                            type: string
                                            minLength: 1
                                        required:
                                          - type
                                          - targetId
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - listId
                                    - matchRules
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: github
                                    installationId:
                                      type: integer
                                      exclusiveMinimum: 0
                                      maximum: 9007199254740991
                                    repositoryId:
                                      type: integer
                                      exclusiveMinimum: 0
                                      maximum: 9007199254740991
                                    event:
                                      type: string
                                      minLength: 1
                                    action:
                                      type: string
                                      minLength: 1
                                    matchRules:
                                      minItems: 1
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          type:
                                            type: string
                                            enum:
                                              - owner
                                              - creator
                                              - status
                                              - label
                                              - assignee
                                          targetId:
                                            type: string
                                            minLength: 1
                                        required:
                                          - type
                                          - targetId
                                        additionalProperties: false
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - installationId
                                    - repositoryId
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    conditions:
                                      type: object
                                      propertyNames:
                                        type: string
                                      additionalProperties: {}
                                    provider:
                                      type: string
                                      const: cloudflareTail
                                    integrationId:
                                      type: string
                                      minLength: 1
                                    destination:
                                      type: string
                                    secretConfigured:
                                      type: boolean
                                  required:
                                    - provider
                                    - integrationId
                                  additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: jobLifecycle
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                sourceJobIds:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                                states:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    enum:
                                      - succeeded
                                      - failed
                                      - stopped
                                      - edited
                              required:
                                - sourceJobIds
                                - states
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                        - type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            slug:
                              type: string
                            kind:
                              type: string
                              const: jobIdle
                            enabled:
                              default: true
                              type: boolean
                            config:
                              type: object
                              properties:
                                sourceJobIds:
                                  minItems: 1
                                  type: array
                                  items:
                                    type: string
                                    minLength: 1
                              required:
                                - sourceJobIds
                              additionalProperties: false
                            jobId:
                              type: string
                              format: uuid
                              pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                            createdAt:
                              type: string
                            updatedAt:
                              type: string
                          required:
                            - id
                            - slug
                            - kind
                            - enabled
                            - config
                            - jobId
                            - createdAt
                            - updatedAt
                          additionalProperties: false
                  skills:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                        key:
                          type: string
                        revision:
                          type: integer
                          exclusiveMinimum: 0
                          maximum: 9007199254740991
                        position:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                      required:
                        - id
                        - key
                        - revision
                        - position
                      additionalProperties: false
                  createdAt:
                    type: string
                  updatedAt:
                    type: string
                required:
                  - id
                  - name
                  - slug
                  - enabled
                  - promptTemplate
                  - runNameTemplate
                  - model
                  - executionConfig
                  - executionConfigId
                  - agentKind
                  - concurrencyLimit
                  - runningCount
                  - currentRuns
                  - maxConcurrency
                  - lastRunState
                  - triggers
                  - createdAt
                  - updatedAt
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
          description: "stale_job: reload and reconcile before retrying"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: put_api_v1_jobs_jobId
      tags:
        - jobs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:write
      x-owner-session-required: false
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                projectId:
                  type: string
                  format: uuid
                  pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                name:
                  type: string
                  minLength: 1
                  maxLength: 120
                slug:
                  type: string
                  pattern: ^[a-z][a-z0-9_-]{0,29}$
                promptTemplate:
                  type: string
                  minLength: 1
                  maxLength: 50000
                runNameTemplate:
                  type: string
                  maxLength: 500
                concurrencyLimit:
                  default: 1
                  type: integer
                  minimum: 1
                  maximum: 50
                executionConfigId:
                  type: string
                  minLength: 1
                tags:
                  maxItems: 20
                  type: array
                  items:
                    type: string
                    pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$
                vmImage:
                  type: string
                  maxLength: 512
                  pattern: ^(?:(?:(?:[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*\/)?[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*(?:\/[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*)*(?::[A-Za-z0-9_][A-Za-z0-9_.-]{0,127})?(?:@sha256:[a-f0-9]{64})?))?$
                model:
                  type: string
                  maxLength: 120
                effort:
                  type: string
                  maxLength: 40
                triggers:
                  default: []
                  maxItems: 50
                  type: array
                  items:
                    oneOf:
                      - type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                          slug:
                            type: string
                            pattern: ^trigger-[1-9][0-9]*$
                          kind:
                            type: string
                            const: manual
                          enabled:
                            default: true
                            type: boolean
                          config:
                            default: {}
                            type: object
                            properties: {}
                            additionalProperties: false
                        required:
                          - kind
                        additionalProperties: false
                      - type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                          slug:
                            type: string
                            pattern: ^trigger-[1-9][0-9]*$
                          kind:
                            type: string
                            const: schedule
                          enabled:
                            default: true
                            type: boolean
                          config:
                            type: object
                            properties:
                              cron:
                                type: string
                                minLength: 1
                              timezone:
                                type: string
                                minLength: 1
                            required:
                              - cron
                              - timezone
                            additionalProperties: false
                        required:
                          - kind
                          - config
                        additionalProperties: false
                      - type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                          slug:
                            type: string
                            pattern: ^trigger-[1-9][0-9]*$
                          kind:
                            type: string
                            const: webhook
                          enabled:
                            default: true
                            type: boolean
                          config:
                            oneOf:
                              - type: object
                                properties:
                                  conditions:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties: {}
                                  provider:
                                    type: string
                                    const: linear
                                  projectId:
                                    type: string
                                    minLength: 1
                                  matchRules:
                                    minItems: 1
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - owner
                                            - creator
                                            - status
                                            - label
                                            - assignee
                                        targetId:
                                          type: string
                                          minLength: 1
                                      required:
                                        - type
                                        - targetId
                                required:
                                  - provider
                                  - projectId
                                  - matchRules
                                additionalProperties: false
                              - type: object
                                properties:
                                  conditions:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties: {}
                                  provider:
                                    type: string
                                    const: clickup
                                  listId:
                                    type: string
                                    minLength: 1
                                  matchRules:
                                    minItems: 1
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - owner
                                            - creator
                                            - status
                                            - label
                                            - assignee
                                        targetId:
                                          type: string
                                          minLength: 1
                                      required:
                                        - type
                                        - targetId
                                required:
                                  - provider
                                  - listId
                                  - matchRules
                                additionalProperties: false
                              - type: object
                                properties:
                                  conditions:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties: {}
                                  provider:
                                    type: string
                                    const: github
                                  installationId:
                                    type: integer
                                    exclusiveMinimum: 0
                                    maximum: 9007199254740991
                                  repositoryId:
                                    type: integer
                                    exclusiveMinimum: 0
                                    maximum: 9007199254740991
                                  event:
                                    type: string
                                    minLength: 1
                                  action:
                                    type: string
                                    minLength: 1
                                  matchRules:
                                    minItems: 1
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        type:
                                          type: string
                                          enum:
                                            - owner
                                            - creator
                                            - status
                                            - label
                                            - assignee
                                        targetId:
                                          type: string
                                          minLength: 1
                                      required:
                                        - type
                                        - targetId
                                required:
                                  - provider
                                  - installationId
                                  - repositoryId
                                additionalProperties: false
                              - type: object
                                properties:
                                  conditions:
                                    type: object
                                    propertyNames:
                                      type: string
                                    additionalProperties: {}
                                  provider:
                                    type: string
                                    const: cloudflareTail
                                  integrationId:
                                    type: string
                                    minLength: 1
                                required:
                                  - provider
                                  - integrationId
                                additionalProperties: false
                        required:
                          - kind
                          - config
                        additionalProperties: false
                      - type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                          slug:
                            type: string
                            pattern: ^trigger-[1-9][0-9]*$
                          kind:
                            type: string
                            const: jobLifecycle
                          enabled:
                            default: true
                            type: boolean
                          config:
                            type: object
                            properties:
                              sourceJobIds:
                                minItems: 1
                                type: array
                                items:
                                  type: string
                                  minLength: 1
                              states:
                                minItems: 1
                                type: array
                                items:
                                  type: string
                                  enum:
                                    - succeeded
                                    - failed
                                    - stopped
                                    - edited
                            required:
                              - sourceJobIds
                              - states
                            additionalProperties: false
                        required:
                          - kind
                          - config
                        additionalProperties: false
                      - type: object
                        properties:
                          id:
                            type: string
                            minLength: 1
                          slug:
                            type: string
                            pattern: ^trigger-[1-9][0-9]*$
                          kind:
                            type: string
                            const: jobIdle
                          enabled:
                            default: true
                            type: boolean
                          config:
                            type: object
                            properties:
                              sourceJobIds:
                                minItems: 1
                                type: array
                                items:
                                  type: string
                                  minLength: 1
                            required:
                              - sourceJobIds
                            additionalProperties: false
                        required:
                          - kind
                          - config
                        additionalProperties: false
                skillIds:
                  maxItems: 50
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
                expectedUpdatedAt:
                  type: string
                  format: date-time
                  pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
              required:
                - name
                - slug
                - promptTemplate
                - executionConfigId
              additionalProperties: false
    delete:
      summary: Delete job
      responses:
        "200":
          description: Deleted
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the jobs:write scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: delete_api_v1_jobs_jobId
      tags:
        - jobs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:write
      x-owner-session-required: false
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/runs:
    get:
      summary: List runs
      description: |-
        Returns tenant-authorized runs. Project, job, and state filters accept repeated values and match any selected value within each filter; filters are applied before cursor pagination. When sort is supplied, ordering is applied before cursor pagination; statuses sort lexically by their persisted state, missing values sort last, and ties use run ID. Without sort, runs remain newest-created first.

        Requires the runs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      responses:
        "200":
          description: Paginated runs
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RunPage"
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: get_api_v1_runs
      tags:
        - runs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:read
      x-owner-session-required: false
      parameters:
        - name: projectId
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
                pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
              - minItems: 1
                maxItems: 100
                type: array
                items:
                  type: string
                  format: uuid
                  pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
        - name: jobId
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
                pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
              - minItems: 1
                maxItems: 100
                type: array
                items:
                  type: string
                  format: uuid
                  pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
        - name: state
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - queued
                  - reserved
                  - starting
                  - running
                  - done
                  - blocked
                  - failed
                  - ignored
                  - succeeded
                  - stopping
                  - stopped
              - minItems: 1
                maxItems: 10
                type: array
                items:
                  type: string
                  enum:
                    - queued
                    - reserved
                    - starting
                    - running
                    - done
                    - blocked
                    - failed
                    - ignored
                    - succeeded
                    - stopping
                    - stopped
        - name: contextQuery
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 50000
        - name: sort
          in: query
          required: false
          schema:
            type: string
            enum:
              - job
              - run
              - status
              - created
              - agent
        - name: direction
          in: query
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
        - name: limit
          in: query
          required: false
          schema:
            default: 50
            type: integer
            minimum: 1
            maximum: 100
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            minLength: 1
  /api/v1/search:
    get:
      summary: Search jobs and runs by approximate metadata matches
      description: |-
        Search uses PostgreSQL pg_trgm approximate matching over job names/slugs and run names, issue titles, and issue identifiers. Identifier matching is whole-field trigram matching; names and titles use word-level trigram matching. Exact identifiers and metadata names rank first, followed by the strongest individual field score. Results are unique, tenant-scoped, deterministically ordered, and limited to 100. Blank or punctuation-only queries return no results. One- and two-character queries may return no results because trigram matching is approximate; this is not ordered-character or substring matching.

        Requires the jobs:read and runs:read scopes.

        Accepts a scoped bearer token or interactive owner session.
      responses:
        "200":
          description: Search results
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        kind:
                          type: string
                          enum:
                            - job
                            - run
                            - trace
                        id:
                          type: string
                        title:
                          type: string
                        subtitle:
                          type: string
                        url:
                          type: string
                        source:
                          type: object
                          properties:
                            kind:
                              type: string
                              enum:
                                - job
                                - run
                                - trace
                            label:
                              type: string
                            id:
                              type: string
                          required:
                            - kind
                            - label
                            - id
                          additionalProperties: false
                        match:
                          type: object
                          properties:
                            text:
                              type: string
                            ranges:
                              type: array
                              items:
                                type: object
                                properties:
                                  start:
                                    type: integer
                                    minimum: 0
                                    maximum: 9007199254740991
                                  end:
                                    type: integer
                                    minimum: 0
                                    maximum: 9007199254740991
                                required:
                                  - start
                                  - end
                                additionalProperties: false
                          required:
                            - text
                            - ranges
                          additionalProperties: false
                      required:
                        - kind
                        - id
                        - title
                        - subtitle
                        - url
                        - source
                        - match
                      additionalProperties: false
                required:
                  - items
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: get_api_v1_search
      tags:
        - search
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: jobs:read+runs:read
      x-owner-session-required: false
      parameters:
        - name: q
          in: query
          required: false
          schema:
            default: ""
            type: string
  /api/v1/webhooks/deliveries:
    get:
      summary: Search webhook deliveries
      responses:
        "200":
          description: Cursor-paginated safe delivery records
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the runs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_webhooks_deliveries
      tags:
        - webhooks
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:read
      x-owner-session-required: false
      parameters:
        - name: provider
          in: query
          required: false
          schema:
            type: string
        - name: deliveryId
          in: query
          required: false
          schema:
            type: string
        - name: event
          in: query
          required: false
          schema:
            type: string
        - name: action
          in: query
          required: false
          schema:
            type: string
        - name: outcome
          in: query
          required: false
          schema:
            type: string
        - name: jobId
          in: query
          required: false
          schema:
            type: string
        - name: q
          in: query
          required: false
          schema:
            type: string
        - name: cursor
          in: query
          required: false
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            default: 50
            type: integer
            minimum: 1
            maximum: 100
  /api/v1/webhooks/deliveries/{deliveryId}:
    get:
      summary: Get webhook delivery detail and processing timeline
      responses:
        "200":
          description: Safe delivery detail
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the runs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_webhooks_deliveries_deliveryId
      tags:
        - webhooks
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:read
      x-owner-session-required: false
      parameters:
        - name: deliveryId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/runs/{runId}/status:
    get:
      summary: Get lightweight run status
      description: |-
        No prompt decryption, invocation context, artifacts, activity or diagnostics assembly. Continue polling terminal runs while finalizing is true. trace_revision changes on generation transition or canonical projection/replay; live appends retain the revision. Full detail remains available at GET /runs/{runId}.

        Requires the runs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      responses:
        "200":
          description: Status
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  job_id:
                    type: string
                  project_id:
                    type: string
                  project_name:
                    type: string
                  state:
                    type: string
                    enum:
                      - queued
                      - reserved
                      - starting
                      - running
                      - blocked
                      - stopping
                      - succeeded
                      - failed
                      - stopped
                  run_name:
                    type: string
                  job_name:
                    type: string
                  destination_url:
                    type:
                      - string
                      - "null"
                  created_at:
                    type: string
                  updated_at:
                    type: string
                  started_at:
                    type:
                      - string
                      - "null"
                  artifact_state:
                    type: string
                    enum:
                      - pending
                      - collecting
                      - stored
                      - partial
                      - failed
                  finalizing:
                    type: boolean
                  trace_revision:
                    type: string
                  failure_source:
                    anyOf:
                      - type: string
                        enum:
                          - system
                          - agent
                      - type: "null"
                  agent_error:
                    anyOf:
                      - type: object
                        properties:
                          reason:
                            type: string
                          reported_at:
                            type: string
                          reporter:
                            type: object
                            properties:
                              user_id:
                                type: string
                              kind:
                                type: string
                                enum:
                                  - api_key
                                  - oauth
                                  - session
                              id:
                                type: string
                            required:
                              - user_id
                              - kind
                              - id
                            additionalProperties: false
                        required:
                          - reason
                          - reported_at
                          - reporter
                        additionalProperties: false
                      - type: "null"
                required:
                  - id
                  - job_id
                  - state
                  - run_name
                  - job_name
                  - destination_url
                  - created_at
                  - updated_at
                  - started_at
                  - artifact_state
                  - finalizing
                  - trace_revision
                  - failure_source
                  - agent_error
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: get_api_v1_runs_runId_status
      tags:
        - runs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:read
      x-owner-session-required: false
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
  /api/v1/runs/{runId}/trace-pages:
    get:
      summary: Get revision-bound trace page
      description: |-
        First request omits revision and uses after=0. Subsequent requests supply the returned revision. A changed generation or canonical projection returns reset=true and events from zero in the new revision, from one database snapshot. Discard all cached old pages before merging the response. nextCursor=null means caught up, not finalized; poll after the last sequence while active/finalizing. Legacy GET /trace remains unchanged.

        Requires the runs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      responses:
        "200":
          description: Revision-bound page
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        sequence:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        id:
                          type: string
                        parentId:
                          type: string
                        type:
                          type: string
                          enum:
                            - user_message
                            - assistant_message
                            - reasoning
                            - tool_call
                            - tool_result
                            - command
                            - file_change
                            - compaction
                            - branch
                            - usage
                            - warning
                            - error
                            - metadata
                        role:
                          type: string
                        title:
                          type: string
                        preview:
                          type: string
                        occurredAt:
                          type: string
                        display:
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties: {}
                      required:
                        - sequence
                        - id
                        - type
                        - title
                        - preview
                        - display
                      additionalProperties: false
                  nextCursor:
                    anyOf:
                      - type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      - type: "null"
                  previousCursor:
                    anyOf:
                      - type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      - type: "null"
                  revision:
                    type: string
                  reset:
                    type: boolean
                required:
                  - items
                  - nextCursor
                  - revision
                  - reset
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: get_api_v1_runs_runId_trace_pages
      tags:
        - runs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:read
      x-owner-session-required: false
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$
        - name: after
          in: query
          required: false
          schema:
            default: 0
            type: integer
            minimum: 0
            maximum: 9007199254740991
        - name: before
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 9007199254740991
        - name: recent
          in: query
          required: false
          schema:
            default: false
            type: boolean
        - name: limit
          in: query
          required: false
          schema:
            default: 100
            type: integer
            minimum: 1
            maximum: 200
        - name: revision
          in: query
          required: false
          schema:
            type: string
            maxLength: 1000
  /api/v1/runs/{runId}:
    get:
      summary: Get run
      responses:
        "200":
          description: Run including durable execution diagnostics and harness artifact location
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RunDetail"
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the runs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_runs_runId
      tags:
        - runs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:read
      x-owner-session-required: false
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
    patch:
      summary: Rename run
      description: |-
        Changes only the run display name. Supply expectedName for optimistic concurrency; omission supports last-writer-wins clients.

        Requires the runs:write scope.

        Accepts a scoped bearer token or interactive owner session.
      responses:
        "200":
          description: Saved run display name
          content:
            application/json:
              schema:
                type: object
                required:
                  - run_name
                properties:
                  run_name:
                    type: string
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
          description: Run not found within the tenant
        "409":
          $ref: "#/components/responses/Error409"
          description: "stale_run_name: reload before retrying"
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: patch_api_v1_runs_runId
      tags:
        - runs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:write
      x-owner-session-required: false
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 120
                expectedName:
                  type: string
                  maxLength: 120
              required:
                - name
              additionalProperties: false
  /api/v1/runs/{runId}/report-error:
    post:
      summary: Report an error for an active run
      description: |-
        Records a sanitized reason and authenticated reporter without changing run execution or releasing its concurrency slot. The agent may continue work and should then exit normally. An identical retry succeeds; a different replacement reason returns 409. Terminal runs reject reports.

        Requires the runs:write scope.

        Accepts a scoped bearer token or interactive owner session.
      responses:
        "200":
          description: Report saved or identical retry acknowledged
          content:
            application/json:
              schema:
                type: object
                properties:
                  reported:
                    type: boolean
                    const: true
                  reason:
                    type: string
                  retry:
                    type: boolean
                required:
                  - reported
                  - reason
                  - retry
                additionalProperties: false
        "400":
          $ref: "#/components/responses/Error400"
          description: Invalid reason or request body
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
          description: Missing runs:write authorization
        "404":
          $ref: "#/components/responses/Error404"
          description: Run not found within the tenant
        "409":
          $ref: "#/components/responses/Error409"
          description: Run is terminal or a different reason was already reported
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      operationId: post_api_v1_runs_runId_report_error
      tags:
        - runs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:write
      x-owner-session-required: false
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
                  minLength: 1
                  maxLength: 2000
              required:
                - reason
              additionalProperties: false
  /api/v1/runs/{runId}/trace:
    get:
      summary: Get paginated run trace events
      responses:
        "200":
          description: Trace page
          content:
            application/json:
              schema:
                type: object
                required:
                  - items
                  - nextCursor
                properties:
                  items:
                    type: array
                    items:
                      type: object
                  nextCursor:
                    type:
                      - integer
                      - "null"
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the runs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_runs_runId_trace
      tags:
        - runs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:read
      x-owner-session-required: false
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
        - name: after
          in: query
          required: false
          schema:
            default: 0
            type: integer
            minimum: 0
            maximum: 9007199254740991
        - name: limit
          in: query
          required: false
          schema:
            default: 100
            type: integer
            minimum: 1
            maximum: 200
  /api/v1/runs/{runId}/trace/replay:
    post:
      summary: Replay a retained trace artifact or restore a native-session projection
      description: |-
        Requires runs:cancel and an interactive tenant owner session. One terminal run per request, limited to 10 attempts per tenant per minute including retries and failures. Projection and result commit atomically; no artifacts are deleted. Retry failed requests with the same requestId. Conflicting reuse is rejected. Missing bytes cannot be recovered. Does not change the source declaration of an active or future run.

        Requires the runs:cancel scope.

        An interactive owner session is required; bearer tokens cannot call this operation.
      responses:
        "200":
          description: Durable replay result
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TraceReplayResult"
        "400":
          $ref: "#/components/responses/Error400"
          description: Invalid request
        "401":
          $ref: "#/components/responses/Error401"
          description: Invalid owner session
        "403":
          $ref: "#/components/responses/Error403"
          description: Missing runs:cancel scope or interactive owner session
        "404":
          $ref: "#/components/responses/Error404"
          description: Run not found within the tenant
        "409":
          $ref: "#/components/responses/Error409"
          description: Request ID conflict or artifact ownership/checksum mismatch
        "415":
          $ref: "#/components/responses/Error415"
        "429":
          $ref: "#/components/responses/Error429"
          description: Tenant rate limit reached; wait one minute before retrying
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
          description: Artifact storage unavailable
      operationId: post_api_v1_runs_runId_trace_replay
      tags:
        - runs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:cancel
      x-owner-session-required: true
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TraceReplayRequest"
  /api/v1/runs/{runId}/diagnostics:
    get:
      summary: Get credential-safe run lifecycle diagnostics
      responses:
        "200":
          description: Credential-safe execution metadata and durable harness artifact location
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RunDiagnostics"
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the runs:read scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: get_api_v1_runs_runId_diagnostics
      tags:
        - runs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:read
      x-owner-session-required: false
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/runs/{runId}/stop:
    post:
      summary: Stop run
      responses:
        "200":
          description: Stopped
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the runs:cancel scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_runs_runId_stop
      tags:
        - runs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:cancel
      x-owner-session-required: false
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
  /api/v1/runs/{runId}/kill:
    post:
      summary: Kill run and immediately release its concurrency slot
      responses:
        "200":
          description: Killed
          content:
            application/json:
              schema:
                type: object
        "400":
          $ref: "#/components/responses/Error400"
        "401":
          $ref: "#/components/responses/Error401"
        "403":
          $ref: "#/components/responses/Error403"
        "404":
          $ref: "#/components/responses/Error404"
        "409":
          $ref: "#/components/responses/Error409"
        "429":
          $ref: "#/components/responses/Error429"
        "500":
          $ref: "#/components/responses/Error500"
        "503":
          $ref: "#/components/responses/Error503"
      description: |-
        Requires the runs:cancel scope.

        Accepts a scoped bearer token or interactive owner session.
      operationId: post_api_v1_runs_runId_kill
      tags:
        - runs
      security:
        - bearerAuth: []
        - cookieAuth: []
      x-required-scope: runs:cancel
      x-owner-session-required: false
      parameters:
        - name: runId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
