Skip to content

Lighthouse OpenAPI Spec


openapi: 3.0.0
info:
  version: 1.0
  title: Lighthouse API

servers:
  - url: https://lighthouse.admantium.com/

components:
  schemas:
    ScanResponse:
      type: object
      properties:
        msg:
          type: string
        code:
          type: integer
        uuid:
          type: string
    JobResponse:
      type: object
      properties:
        msg:
          type: string
        code:
          type: integer
        job:
          type: object
          properties:
            uuid:
              type: string
            domain:
              type: string
            status:
              type: string
    DefaultError:
      type: object
      properties:
        statusCode:
          type: integer
        error:
          type: string
        message:
          type: string

paths:
  /scan:
    get:
      description: Initiate a webpage scan
      parameters:
        - name: url
          in: query
          schema:
            type: string
      responses:
        200:
          description: Webpage scan is accepted and will be processed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanResponse'
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultError'
        429:
          description: Scan requests can not be accepted, all workers are occupied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanResponse'
  /api/jobs:
    get:
      description: Get the job status for the provided `uuid`
      parameters:
        - name: uuid
          in: query
          schema:
            type: string
      responses:
        200:
          description: 'JOB status: finished'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'
        202:
          description: 'JOB status: started'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultError'
        409:
          description: 'JOB status: error'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'
  /api/reports:
    get:
      description: Get the finished report for the scan job identified by `uuid`
      parameters:
        - name: uuid
          in: query
          schema:
            type: string
      responses:
        200:
          description: Returns scan report for finished jobs
          content:
            text/plain:
              schema:
                type: string
        202:
          description: Returns job details for non-finished job
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'
        400:
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultError'
        409:
          description: Returns job details for job finished with an error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'