openapi: 3.1.0
info:
  title: AutoExplore Public API
  description: Public machine-to-machine API for starting and resetting coverage runs.
  contact:
    name: AutoExplore Support
    url: https://autoexplore.ai
    email: support@autoexplore.ai
  license:
    name: All rights reserved, AutoExplore Oy
    identifier: All rights reserved, AutoExplore Oy
  version: 0.1.0
servers:
- url: https://public-api.autoexplore.ai
paths:
  /public/v1/target_software_env/{target_software_env}/coverage_runs:
    post:
      tags:
      - Coverage Runs
      description: Start a new coverage run for the target software environment.
      operationId: start_coverage_run_doc
      parameters:
      - name: target_software_env
        in: path
        description: Target software environment ID
        required: true
        schema:
          type: string
          format: uuid
      - name: Idempotency-Key
        in: header
        description: Idempotency key
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartCoverageRunRequest'
        required: true
      responses:
        '201':
          description: Coverage run started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CoverageRunResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
      security:
      - bearerAuth: []
  /public/v1/target_software_env/{target_software_env}/coverage_runs/reset_active:
    post:
      tags:
      - Coverage Runs
      description: Reset the currently active coverage run for the target software environment.
      operationId: reset_active_coverage_run_doc
      parameters:
      - name: target_software_env
        in: path
        description: Target software environment ID
        required: true
        schema:
          type: string
          format: uuid
      - name: Idempotency-Key
        in: header
        description: Idempotency key
        required: true
        schema:
          type: string
      responses:
        '202':
          description: Active coverage run reset
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResetCoverageRunResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '500':
          description: Internal server error
      security:
      - bearerAuth: []
components:
  schemas:
    CoverageRunResponse:
      type: object
      required:
      - coverage_id
      - start_ts
      properties:
        coverage_id:
          type: integer
          format: int32
        start_ts:
          type: string
          format: date-time
        stop_ts_previous_run:
          type:
          - string
          - 'null'
          format: date-time
    ResetCoverageRunResponse:
      type: object
      required:
      - coverage_id
      - reset_ts
      properties:
        coverage_id:
          type: integer
          format: int32
        reset_ts:
          type: string
          format: date-time
    StartCoverageRunRequest:
      type: object
      properties:
        name:
          type:
          - string
          - 'null'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
tags:
- name: Coverage Runs
  description: Public coverage run operations
- name: Documentation
  description: OpenAPI schema endpoints
