openapi: 3.1.0
info:
  title: SupportRunner API
  version: 1.0.0
  description: Public discovery and health contract for the SupportRunner API boundary.
  contact:
    email: hello@supportrunner.ai
servers:
  - url: https://api.supportrunner.ai
    description: Production API
paths:
  /v1:
    get:
      operationId: getApiIndex
      summary: Discover the current API contract
      responses:
        "200":
          description: API discovery document
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiIndex"
  /v1/health:
    get:
      operationId: getApiHealth
      summary: Check the public API edge
      responses:
        "200":
          description: API edge is available
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Health"
  /.well-known/supportrunner:
    get:
      operationId: getServiceTopology
      summary: Discover SupportRunner public service surfaces
      responses:
        "200":
          description: Public-safe topology document
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Topology"
components:
  schemas:
    ApiIndex:
      type: object
      required: [service, service_id, version, endpoints, request_id]
      properties:
        service: { type: string, const: SupportRunner API }
        service_id: { type: string, const: support-runner-api }
        version: { type: string, const: v1 }
        environment: { type: string }
        documentation: { type: string, format: uri }
        openapi: { type: string, format: uri }
        endpoints: { type: object, additionalProperties: { type: string } }
        request_id: { type: string }
    Health:
      type: object
      required: [service, status, version, checked_at, request_id]
      properties:
        service: { type: string, const: support-runner-api }
        status: { type: string, const: ok }
        version: { type: string, const: v1 }
        environment: { type: string }
        checked_at: { type: string, format: date-time }
        request_id: { type: string }
    Surface:
      type: object
      required: [id, url, state]
      properties:
        id: { type: string }
        url: { type: string, format: uri }
        state:
          type: string
          enum: [live, ready-to-activate, planned, planned-protected]
    Topology:
      type: object
      required: [product, canonical, surfaces, request_id]
      properties:
        product: { type: string, const: SupportRunner }
        canonical: { type: string, format: uri }
        surfaces:
          type: array
          items: { $ref: "#/components/schemas/Surface" }
        request_id: { type: string }
