openapi: 3.0.4
info:
  title: Verisys Antivirus API
  contact:
    name: Ionx Solutions
    url: https://www.ionxsolutions.com
    email: support@ionxsolutions.com
  version: '1.0'
  x-logo:
    url: https://www.ionxsolutions.com/img/logo.png
    altText: Ionx Solutions logo
    href: https://www.ionxsolutions.com
servers:
  - url: https://ap1.api.av.ionxsolutions.com
    description: Asia Pacific
  - url: https://eu1.api.av.ionxsolutions.com
    description: Europe
  - url: https://gb1.api.av.ionxsolutions.com
    description: UK
  - url: https://us1.api.av.ionxsolutions.com
    description: USA
paths:
  '/v1/malware/{id}':
    get:
      tags:
        - Malware
      summary: Fetch Scan Result
      description: Fetch the result of a previously submitted malware scan job.
      operationId: Malware.GetResult
      parameters:
        - name: id
          in: path
          description: Identifier of the malware scan job to fetch results for
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Invalid API key
        '200':
          description: Returns the result of a previously submitted malware scan job
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanResult'
        '422':
          description: Validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '403':
          description: Insufficient credit quota remaining
  /v1/malware/scan/file:
    post:
      tags:
        - Malware
      summary: Scan File
      description: Scans a file for malware.
      operationId: Malware.ScanFile
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - file
              type: object
              properties:
                file:
                  type: string
                  format: binary
                file_name:
                  type: string
                  example: my-file.docx
            encoding:
              file:
                style: form
              file_name:
                style: form
      responses:
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Invalid API key
        '201':
          description: File has been scanned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanResult'
        '422':
          description: Validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '400':
          description: Bad request
        '403':
          description: Insufficient credit quota remaining
        '415':
          description: Unsupported media type
  /v1/malware/scan/url:
    post:
      tags:
        - Malware
      summary: Scan URL
      description: Downloads and scans a file for malware.
      operationId: Malware.ScanUrl
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanUrlCommand'
      responses:
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Invalid API key
        '201':
          description: File has been scanned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanResult'
        '422':
          description: Validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '400':
          description: Bad request
        '403':
          description: Insufficient credit quota remaining
        '415':
          description: Unsupported media type
  /v1/malware/submit/file:
    post:
      tags:
        - Malware
      summary: Submit File
      description: "Submits a file for asynchronous malware scanning.\r\n            \r\nThe result can be obtained later by calling ```GET /v1/malware/{id}```. Alternatively, if\r\na webhook callback URL is provided, the result will be sent automatically when ready."
      operationId: Malware.SubmitFile
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - file
              type: object
              properties:
                file:
                  type: string
                  format: binary
                file_name:
                  type: string
                  example: my-file.docx
                callback_url:
                  type: string
                  example: https://www.example.com/webhook
            encoding:
              file:
                style: form
              file_name:
                style: form
              callback_url:
                style: form
      responses:
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Invalid API key
        '202':
          description: Scan job submitted
          headers:
            X-API-Result:
              description: Identifier of the newly created malware scan job
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanReceipt'
        '422':
          description: Validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '400':
          description: Bad request
        '403':
          description: Insufficient credit quota remaining
        '415':
          description: Unsupported media type
  /v1/malware/submit/url:
    post:
      tags:
        - Malware
      summary: Submit URL
      description: "Submits a URL for asynchronous malware scanning.\r\n            \r\nThe result can be obtained later by calling ```GET /v1/malware/{id}```. Alternatively, if\r\na webhook callback URL is provided, the result will be sent automatically when ready."
      operationId: Malware.SubmitUrl
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitUrlCommand'
      responses:
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Invalid API key
        '202':
          description: Scan job submitted
          headers:
            X-API-Result:
              description: Identifier of the newly created malware scan job
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanReceipt'
        '422':
          description: Validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '400':
          description: Bad request
        '403':
          description: Insufficient credit quota remaining
        '415':
          description: Unsupported media type
  '/v1/nsfw/images/{id}':
    get:
      tags:
        - NSFW
      summary: Fetch Scan Result
      description: Fetch the result of a previously submitted NSFW (Not Safe for Work) image scan job.
      operationId: Nsfw.Images.GetResult
      parameters:
        - name: id
          in: path
          description: Identifier of the NSFW image scan job to fetch results for
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Invalid API key
        '200':
          description: Returns the result of a previously submitted NSFW image scan job
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanResult'
        '422':
          description: Validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '403':
          description: Insufficient credit quota remaining
  /v1/nsfw/images/scan/file:
    post:
      tags:
        - NSFW
      summary: Scan File
      description: "Scans an image file for NSFW (Not Safe for Work) content. Supported image file types:\r\n  - JPEG\r\n  - PNG\r\n  - GIF\r\n  - WebP"
      operationId: Nsfw.Images.ScanFile
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - file
              type: object
              properties:
                file:
                  type: string
                  format: binary
                file_name:
                  type: string
                  example: my-file.docx
            encoding:
              file:
                style: form
              file_name:
                style: form
      responses:
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Invalid API key
        '201':
          description: Image file has been scanned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanResult'
        '422':
          description: Validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '400':
          description: Bad request
        '403':
          description: Insufficient credit quota remaining
        '415':
          description: Unsupported media type
  /v1/nsfw/images/scan/url:
    post:
      tags:
        - NSFW
      summary: Scan URL
      description: "Downloads and scans an image file for NSFW (Not Safe for Work) content. Supported image file types:\r\n  - JPEG\r\n  - PNG\r\n  - GIF\r\n  - WebP"
      operationId: Nsfw.Images.ScanUrl
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanUrlCommand'
      responses:
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Invalid API key
        '201':
          description: Image file has been scanned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanResult'
        '422':
          description: Validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '400':
          description: Bad request
        '403':
          description: Insufficient credit quota remaining
        '415':
          description: Unsupported media type
  /v1/nsfw/images/submit/file:
    post:
      tags:
        - NSFW
      summary: Submit File
      description: "Submits a file for asynchronous NSFW image scanning. Supported image file types:\r\n  - JPEG\r\n  - PNG\r\n  - GIF\r\n  - WebP\r\n            \r\nThe result can be obtained later by calling ```GET /v1/nsfw/images/{id}```. Alternatively,\r\nif a webhook callback URL is provided, the result will be sent automatically when ready."
      operationId: Nsfw.Images.SubmitFile
      requestBody:
        content:
          multipart/form-data:
            schema:
              required:
                - file
              type: object
              properties:
                file:
                  type: string
                  format: binary
                file_name:
                  type: string
                  example: my-file.docx
                callback_url:
                  type: string
                  example: https://www.example.com/webhook
            encoding:
              file:
                style: form
              file_name:
                style: form
              callback_url:
                style: form
      responses:
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Invalid API key
        '202':
          description: Scan job submitted
          headers:
            X-API-Result:
              description: Identifier of the submitted NSFW scan job
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanReceipt'
        '422':
          description: Validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '400':
          description: Bad request
        '403':
          description: Insufficient credit quota remaining
        '415':
          description: Unsupported media type
  /v1/nsfw/images/submit/url:
    post:
      tags:
        - NSFW
      summary: Submit URL
      description: "Submits a URL for asynchronous NSFW image scanning. Supported image file types:\r\n  - JPEG\r\n  - PNG\r\n  - GIF\r\n  - WebP\r\n            \r\nThe result can be obtained later by calling ```GET /v1/nsfw/images/{id}```. Alternatively,\r\nif a webhook callback URL is provided, the result will be sent automatically when ready."
      operationId: Nsfw.Images.SubmitUrl
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitUrlCommand'
      responses:
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Invalid API key
        '202':
          description: Scan job submitted
          headers:
            X-API-Result:
              description: Identifier of the submitted NSFW scan job
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanReceipt'
        '422':
          description: Validation errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
        '400':
          description: Bad request
        '403':
          description: Insufficient credit quota remaining
        '415':
          description: Unsupported media type
  /v1/me:
    get:
      tags:
        - General
      summary: Fetch Account Info
      description: "Fetch information about your Subscription account, including:\r\n            \r\n- Plan name\r\n- Plan credit limit\r\n- Number of credits remaining\r\n- Billing period start date\r\n- Billing period end date"
      operationId: General.Me
      responses:
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Invalid API key
        '200':
          description: Returns account information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Account'
        '403':
          description: Insufficient credit quota remaining
  /v1/ping:
    get:
      tags:
        - General
      summary: Test Endpoint
      description: Can be used to test API connectivity and authentication.
      operationId: General.Ping
      responses:
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Invalid API key
        '200':
          description: Returns an empty body
        '403':
          description: Insufficient credit quota remaining
components:
  schemas:
    Account:
      required:
        - created_date
        - credit_limit
        - credit_remaining
        - period_end_date
        - period_start_date
        - plan
      type: object
      properties:
        plan:
          type: string
        credit_limit:
          type: integer
          format: int32
        credit_remaining:
          type: integer
          format: int32
        created_date:
          type: string
          format: date-time
        period_start_date:
          type: string
          format: date-time
        period_end_date:
          type: string
          format: date-time
      additionalProperties: false
    JobType:
      enum:
        - malware
        - nsfw_image
        - nsfw_text
      type: string
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: { }
    ScanReceipt:
      required:
        - id
      type: object
      properties:
        id:
          type: string
          format: uuid
      additionalProperties: false
    ScanResult:
      required:
        - content_length
        - content_type
        - created_at
        - id
        - scan_type
        - status
      type: object
      properties:
        id:
          type: string
          format: uuid
        scan_type:
          $ref: '#/components/schemas/JobType'
        status:
          $ref: '#/components/schemas/ScanResultType'
        content_length:
          type: integer
          description: 'Size of the scanned content, in bytes'
          format: int64
        content_type:
          type: string
          description: 'The detected media type, determined by inspecting file content, e.g. `application/gzip`'
        signals:
          type: array
          items:
            type: string
          description: 'Threat intelligence, including the names of any malware found'
          nullable: true
        metadata:
          type: object
          additionalProperties:
            type: string
          description: 'Content metadata, including SHA-1 and SHA-256 hashes'
          nullable: true
        created_at:
          type: string
          description: Time when the Job was first submitted
          format: date-time
        completed_at:
          type: string
          description: Time when the Job was completed (whether it resulted in an error or not)
          format: date-time
          nullable: true
      additionalProperties: false
    ScanResultType:
      enum:
        - pending
        - clean
        - threat
        - error
      type: string
    ScanUrlCommand:
      required:
        - file_url
      type: object
      properties:
        file_url:
          type: string
          example: https://www.example.com/my-file
        file_name:
          type: string
          nullable: true
          example: my-file.docx
      additionalProperties: false
    SubmitUrlCommand:
      required:
        - file_url
      type: object
      properties:
        file_url:
          type: string
          example: https://www.example.com/my-file
        file_name:
          type: string
          nullable: true
          example: my-file.docx
        callback_url:
          type: string
          nullable: true
          example: https://www.example.com/webhook
      additionalProperties: false
    ValidationProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      additionalProperties: { }
  securitySchemes:
    api-key:
      type: apiKey
      description: API key
      name: X-API-Key
      in: header
security:
  - api-key: [ ]
tags:
  - name: Malware
  - name: NSFW
  - name: General