openapi: 3.0.3
info:
  title: MayExecute Lite API
  version: 1.2.0
  description: Open-source EG Six Conditions Checker for pre-execution governance of AI-enabled actions.
  license:
    name: MIT
servers:
  - url: https://mayexecute.com
paths:
  /healthz:
    get:
      summary: Health check
      responses:
        '200':
          description: OK
  /api/check:
    post:
      summary: Create one MayExecute governance record
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckRequest'
      responses:
        '201':
          description: Record created
  /api/batch-check:
    post:
      summary: Create multiple MayExecute governance records
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                privacy_mode:
                  type: string
                  enum: [standard, hash_only]
                actions:
                  type: array
                  maxItems: 100
                  items:
                    $ref: '#/components/schemas/CheckRequest'
      responses:
        '201':
          description: Batch records created
  /verify/{token}:
    get:
      summary: Public verification page
      parameters:
        - name: token
          in: path
          required: true
          schema: { type: string }
      responses:
        '200': { description: Verification page }
  /api/checks/{token}.json:
    get:
      summary: Retrieve a JSON governance record
      parameters:
        - name: token
          in: path
          required: true
          schema: { type: string }
      responses:
        '200': { description: JSON record }
  /api/checks/{token}.md:
    get:
      summary: Export Markdown report
      parameters:
        - name: token
          in: path
          required: true
          schema: { type: string }
      responses:
        '200': { description: Markdown report }
  /api/checks/{token}.pdf:
    get:
      summary: Export PDF report
      parameters:
        - name: token
          in: path
          required: true
          schema: { type: string }
      responses:
        '200': { description: PDF report }
components:
  schemas:
    Answer:
      type: string
      enum: [yes, unclear, no]
    CheckRequest:
      type: object
      properties:
        action_title: { type: string }
        system_or_context: { type: string }
        proposed_action: { type: string }
        expected_governed_effect: { type: string }
        evidence_reference: { type: string }
        privacy_mode:
          type: string
          enum: [standard, hash_only]
        answers:
          type: object
          properties:
            verified_mandate: { $ref: '#/components/schemas/Answer' }
            valid_constraints: { $ref: '#/components/schemas/Answer' }
            live_context_integrity: { $ref: '#/components/schemas/Answer' }
            accountability: { $ref: '#/components/schemas/Answer' }
            reviewability: { $ref: '#/components/schemas/Answer' }
            sufficient_verifiable_proof: { $ref: '#/components/schemas/Answer' }
        notes:
          type: object
      required: [answers]
