{
  "openapi": "3.1.0",
  "info": {
    "title": "OmniGuard API",
    "version": "1.0.0",
    "summary": "Threat-intelligence lookups with remediation plans, and remote scan/fix of OmniGuard devices.",
    "description": "Check file hashes, files, URLs, domains and IP addresses against VirusTotal, abuse.ch (MalwareBazaar, URLhaus, ThreatFox), AbuseIPDB, Google Safe Browsing and urlscan.io, with a remediation plan in every answer; and scan, fix and monitor the computers running OmniGuard on your licence. Human-readable guide: https://buy.nsite.tech/scan/api\n\nPlans: Free (verified account; 5/min, 50/day, 500/month), Developer (monthly price; 60/min, 50,000/month), Scale (per call; 300/min, 1,000,000/month safety ceiling), and lookups included with an OmniGuard licence (20/min, 300/day). Billable calls are POST /scan and POST /scan/file. Every authenticated response carries X-API-Plan, X-RateLimit-Limit, X-RateLimit-Remaining, X-Quota-Limit, X-Quota-Remaining and X-Quota-Reset.",
    "contact": {
      "name": "nsite.tech",
      "url": "https://nsite.tech"
    },
    "termsOfService": "https://buy.nsite.tech/"
  },
  "servers": [
    {
      "url": "https://buy.nsite.tech"
    }
  ],
  "security": [
    {
      "bearerKey": []
    }
  ],
  "tags": [
    {
      "name": "Plans",
      "description": "Plans, usage and billing."
    },
    {
      "name": "Lookups",
      "description": "Threat-intelligence lookups (billable)."
    },
    {
      "name": "Keys",
      "description": "API keys (signed-in session only)."
    },
    {
      "name": "Devices",
      "description": "Licensed OmniGuard computers (licence required)."
    },
    {
      "name": "Fleet",
      "description": "Across all devices (licence required)."
    },
    {
      "name": "Fixes",
      "description": "Remote fixes (licence required; requesting one is session only)."
    },
    {
      "name": "Alerts",
      "description": "Alert settings and schedules (licence required)."
    }
  ],
  "paths": {
    "/api/api-plans": {
      "get": {
        "tags": [
          "Plans"
        ],
        "summary": "The plans, prices and limits (public)",
        "security": [],
        "responses": {
          "200": {
            "description": "Plans",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanTable"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/usage": {
      "get": {
        "tags": [
          "Plans"
        ],
        "summary": "Your plan, limits and usage",
        "responses": {
          "200": {
            "description": "Usage",
            "headers": {
              "$ref": "#/components/headers/_quota"
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          }
        }
      }
    },
    "/api/v1/status": {
      "get": {
        "tags": [
          "Plans"
        ],
        "summary": "Connected services, your plan and limits",
        "responses": {
          "200": {
            "description": "Status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "providers": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "boolean"
                      }
                    },
                    "plan": {
                      "$ref": "#/components/schemas/PlanId"
                    },
                    "limits": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/v1/billing/checkout": {
      "post": {
        "tags": [
          "Plans"
        ],
        "summary": "Start a paid plan (signed-in session only)",
        "security": [
          {
            "session": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "plan"
                ],
                "properties": {
                  "plan": {
                    "enum": [
                      "developer",
                      "scale"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stripe Checkout URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Url"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Already on a paid API plan; use the billing portal."
          }
        }
      }
    },
    "/api/v1/billing/portal": {
      "post": {
        "tags": [
          "Plans"
        ],
        "summary": "Change or cancel your plan (signed-in session only)",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Stripe billing-portal URL",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Url"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        }
      }
    },
    "/api/v1/scan": {
      "post": {
        "tags": [
          "Lookups"
        ],
        "summary": "Look up a hash, URL, domain or IP (billable)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "target"
                ],
                "properties": {
                  "target": {
                    "type": "string",
                    "examples": [
                      "https://example.com/download.exe",
                      "44d88612fea8a8f36de82e1278abb02f",
                      "203.0.113.7"
                    ]
                  },
                  "type": {
                    "enum": [
                      "hash",
                      "url",
                      "domain",
                      "ip"
                    ],
                    "description": "Detected when omitted."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verdict with remediation",
            "headers": {
              "$ref": "#/components/headers/_quota"
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Scan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "502": {
            "$ref": "#/components/responses/Upstream"
          }
        }
      }
    },
    "/api/v1/scan/file": {
      "post": {
        "tags": [
          "Lookups"
        ],
        "summary": "Check a file by its SHA-256 (billable; up to 32 MB)",
        "parameters": [
          {
            "name": "share",
            "in": "query",
            "schema": {
              "enum": [
                "0",
                "1"
              ]
            },
            "description": "1 = upload an unknown file to VirusTotal (shared with its community). Developer, Scale and licences only."
          },
          {
            "name": "name",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Scan"
                }
              }
            }
          },
          "202": {
            "description": "Uploaded; poll GET /api/v1/scans/{id}",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Scan"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          },
          "502": {
            "$ref": "#/components/responses/Upstream"
          }
        }
      }
    },
    "/api/v1/scans": {
      "get": {
        "tags": [
          "Lookups"
        ],
        "summary": "Your recent lookups",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lookups",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scans": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ScanSummary"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/scans/{id}": {
      "get": {
        "tags": [
          "Lookups"
        ],
        "summary": "One lookup (refreshes a pending upload)",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "Lookup",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Scan"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/v1/keys": {
      "get": {
        "tags": [
          "Keys"
        ],
        "summary": "Your API keys",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Keys"
          }
        }
      },
      "post": {
        "tags": [
          "Keys"
        ],
        "summary": "Create a key (shown once)",
        "security": [
          {
            "session": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 60
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "key": {
                      "type": "string",
                      "pattern": "^ogk_[A-Za-z0-9_-]{43}$"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Too many keys (10)."
          }
        }
      }
    },
    "/api/v1/keys/{id}": {
      "delete": {
        "tags": [
          "Keys"
        ],
        "summary": "Revoke a key",
        "security": [
          {
            "session": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/v1/devices": {
      "get": {
        "tags": [
          "Devices"
        ],
        "summary": "Your devices",
        "responses": {
          "200": {
            "description": "Devices"
          },
          "402": {
            "$ref": "#/components/responses/LicenceRequired"
          }
        }
      }
    },
    "/api/v1/devices/{id}": {
      "delete": {
        "tags": [
          "Devices"
        ],
        "summary": "Remove a device from your account",
        "description": "Revokes the install: the device leaves every list and a computer can no longer upload or poll for this account. Signed-in session only.",
        "security": [
          {
            "session": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "Removed"
          },
          "402": {
            "$ref": "#/components/responses/LicenceRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/v1/devices/phone": {
      "post": {
        "tags": [
          "Devices"
        ],
        "summary": "Report this iPhone and its safety checks (OmniGuard for iPhone)",
        "description": "Adds the phone to your devices (or updates it) and stores the checks as a finished 'phone' scan. Signed-in session only. A phone removed from your devices answers 409 until it is sent again with restore: true.",
        "security": [
          {
            "session": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "device_id"
                ],
                "properties": {
                  "device_id": {
                    "type": "string",
                    "description": "The app's per-install vendor identifier"
                  },
                  "name": {
                    "type": "string"
                  },
                  "os": {
                    "type": "string"
                  },
                  "app_version": {
                    "type": "string"
                  },
                  "restore": {
                    "type": "boolean"
                  },
                  "checks": {
                    "type": "array",
                    "maxItems": 40,
                    "items": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string"
                        },
                        "ok": {
                          "type": "boolean"
                        },
                        "detail": {
                          "type": "string"
                        },
                        "severity": {
                          "enum": [
                            "info",
                            "low",
                            "medium",
                            "high",
                            "critical"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recorded"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "402": {
            "$ref": "#/components/responses/LicenceRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "This iPhone was removed from your devices."
          },
          "429": {
            "$ref": "#/components/responses/TooMany"
          }
        }
      }
    },
    "/api/v1/devices/{id}/scans": {
      "post": {
        "tags": [
          "Devices"
        ],
        "summary": "Queue a quick or full scan on a device",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "enum": [
                      "quick",
                      "full"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued"
          },
          "402": {
            "$ref": "#/components/responses/LicenceRequired"
          },
          "409": {
            "description": "A scan is already running."
          }
        }
      },
      "get": {
        "tags": [
          "Devices"
        ],
        "summary": "Recent scans of a device",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "Scans"
          }
        }
      }
    },
    "/api/v1/devices/{id}/scans/{scanId}": {
      "get": {
        "tags": [
          "Devices"
        ],
        "summary": "One device scan with findings, indicators, remediation and fixes",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "name": "scanId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scan"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/v1/devices/scans": {
      "post": {
        "tags": [
          "Fleet"
        ],
        "summary": "Queue a scan on every device that allows remote scans",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kind": {
                    "enum": [
                      "quick",
                      "full"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-device results"
          }
        }
      }
    },
    "/api/v1/fleet": {
      "get": {
        "tags": [
          "Fleet"
        ],
        "summary": "Latest scan per device, totals, findings and indicators across devices",
        "responses": {
          "200": {
            "description": "Fleet"
          }
        }
      }
    },
    "/api/v1/fleet/report.csv": {
      "get": {
        "tags": [
          "Fleet"
        ],
        "summary": "The fleet report as CSV",
        "responses": {
          "200": {
            "description": "CSV",
            "content": {
              "text/csv": {}
            }
          }
        }
      }
    },
    "/api/v1/devices/{id}/fixes": {
      "post": {
        "tags": [
          "Fixes"
        ],
        "summary": "Queue OmniGuard's own fix for a finding (session only)",
        "security": [
          {
            "session": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "scan_id",
                  "sig"
                ],
                "properties": {
                  "scan_id": {
                    "type": "string"
                  },
                  "sig": {
                    "type": "string"
                  },
                  "choice": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Queued"
          }
        }
      },
      "get": {
        "tags": [
          "Fixes"
        ],
        "summary": "Recent fixes on a device",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "Fixes"
          }
        }
      }
    },
    "/api/v1/devices/{id}/schedule": {
      "get": {
        "tags": [
          "Alerts"
        ],
        "summary": "A device's scan schedule",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "Schedule"
          }
        }
      },
      "put": {
        "tags": [
          "Alerts"
        ],
        "summary": "Set a device's scan schedule (session only)",
        "security": [
          {
            "session": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "freq": {
                    "enum": [
                      "daily",
                      "weekly",
                      "off"
                    ]
                  },
                  "kind": {
                    "enum": [
                      "quick",
                      "full"
                    ]
                  },
                  "hour": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 23
                  },
                  "weekday": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 6
                  },
                  "tz": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved"
          }
        }
      }
    },
    "/api/v1/alerts": {
      "get": {
        "tags": [
          "Alerts"
        ],
        "summary": "Alert settings and the last 20 alerts",
        "responses": {
          "200": {
            "description": "Alerts"
          }
        }
      },
      "put": {
        "tags": [
          "Alerts"
        ],
        "summary": "Change alert settings (session only)",
        "security": [
          {
            "session": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "boolean"
                  },
                  "webhook_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "level": {
                    "enum": [
                      "malicious",
                      "suspicious",
                      "all"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved; a new webhook URL returns webhook_secret once"
          }
        }
      }
    },
    "/api/v1/devices/{id}/findings/{key}/triage": {
      "put": {
        "tags": [
          "Devices"
        ],
        "summary": "Record your verdict on a finding (for example a false positive)",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A finding key from /api/v1/fleet or a scan."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "verdict"
                ],
                "properties": {
                  "verdict": {
                    "type": "string",
                    "description": "One of the triage verdicts listed in the error message (e.g. false_positive)."
                  },
                  "note": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "delete": {
        "tags": [
          "Devices"
        ],
        "summary": "Clear the verdict on a finding",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A finding key from /api/v1/fleet or a scan."
          }
        ],
        "responses": {
          "200": {
            "description": "Cleared"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/v1/devices/{id}/triage": {
      "get": {
        "tags": [
          "Devices"
        ],
        "summary": "All recorded verdicts for a device",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "Triage"
          }
        }
      }
    },
    "/api/v1/devices/{id}/fixes/{fixId}": {
      "get": {
        "tags": [
          "Fixes"
        ],
        "summary": "One fix: status (queued, sent, done, failed, cancelled) and the device result",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "name": "fixId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Fix"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/v1/alerts/rotate-secret": {
      "post": {
        "tags": [
          "Alerts"
        ],
        "summary": "New webhook secret, returned once (session only)",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "webhook_secret"
          }
        }
      }
    },
    "/api/v1/alerts/test": {
      "post": {
        "tags": [
          "Alerts"
        ],
        "summary": "Send a test alert on every channel (session only)",
        "security": [
          {
            "session": []
          }
        ],
        "responses": {
          "200": {
            "description": "Sent"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "ogk_ API key",
        "description": "Authorization: Bearer ogk_... (X-API-Key also accepted)."
      },
      "session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "connect.sid",
        "description": "The signed-in buy.nsite.tech session."
      }
    },
    "parameters": {
      "id": {
        "name": "id",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "headers": {
      "_quota": {
        "description": "See X-API-Plan, X-RateLimit-Limit, X-RateLimit-Remaining, X-Quota-Limit, X-Quota-Remaining, X-Quota-Reset.",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Bad input",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "No key, or a wrong/revoked key",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "email_unverified, or the action needs the signed-in session",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "LicenceRequired": {
        "description": "licence_required: needs an active OmniGuard licence",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TooMany": {
        "description": "rate_limited (see Retry-After), quota_day or quota_month (see X-Quota-Reset)",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Upstream": {
        "description": "A threat-intelligence service did not answer; retry shortly",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "enum": [
              "email_unverified",
              "licence_required",
              "rate_limited",
              "quota_day",
              "quota_month"
            ]
          },
          "upgrade": {
            "type": "string"
          }
        }
      },
      "PlanId": {
        "enum": [
          "free",
          "developer",
          "scale",
          "included"
        ]
      },
      "Plan": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/PlanId"
          },
          "name": {
            "type": "string"
          },
          "price": {
            "type": "string"
          },
          "billing": {
            "enum": [
              "free",
              "monthly",
              "metered",
              "licence"
            ]
          },
          "perMinute": {
            "type": "integer"
          },
          "perDay": {
            "type": [
              "integer",
              "null"
            ]
          },
          "perMonth": {
            "type": [
              "integer",
              "null"
            ]
          },
          "blurb": {
            "type": "string"
          },
          "available": {
            "type": "boolean"
          }
        }
      },
      "PlanTable": {
        "type": "object",
        "properties": {
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plan"
            }
          },
          "included": {
            "type": "object"
          },
          "billable": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Usage": {
        "type": "object",
        "properties": {
          "plan": {
            "type": "object",
            "properties": {
              "id": {
                "$ref": "#/components/schemas/PlanId"
              },
              "name": {
                "type": "string"
              },
              "price": {
                "type": "string"
              },
              "billing": {
                "type": "string"
              }
            }
          },
          "limits": {
            "type": "object",
            "properties": {
              "perMinute": {
                "type": "integer"
              },
              "perDay": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "perMonth": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          },
          "used": {
            "type": "object",
            "properties": {
              "today": {
                "type": "integer"
              },
              "month": {
                "type": "integer"
              }
            }
          },
          "resets": {
            "type": "object",
            "properties": {
              "day": {
                "type": "string",
                "format": "date-time"
              },
              "month": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "subscription": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "status": {
                "type": "string"
              },
              "renews": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          }
        }
      },
      "Url": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "Verdict": {
        "enum": [
          "malicious",
          "suspicious",
          "clean",
          "unknown"
        ]
      },
      "ScanSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "target": {
            "type": "string"
          },
          "verdict": {
            "$ref": "#/components/schemas/Verdict"
          },
          "status": {
            "enum": [
              "done",
              "pending"
            ]
          },
          "created": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Scan": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ScanSummary"
          },
          {
            "type": "object",
            "properties": {
              "summary": {
                "type": "string"
              },
              "cached": {
                "type": "boolean"
              },
              "providers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "provider": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "verdict": {
                      "$ref": "#/components/schemas/Verdict"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "link": {
                      "type": "string"
                    }
                  }
                }
              },
              "remediation": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "detail": {
                      "type": "string"
                    }
                  }
                }
              },
              "file": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "size": {
                    "type": "integer"
                  },
                  "sha256": {
                    "type": "string"
                  },
                  "shared": {
                    "type": "boolean"
                  }
                }
              },
              "note": {
                "type": "string"
              }
            }
          }
        ]
      }
    }
  }
}
