mlab File Scan API

Upload files and retrieve static analysis results.

GitHub OpenAPI

Operations 3

POST /upload/file Upload a file for analysis #
GET /api/v1/scan/file/results Get file analysis results #
GET /api/v1/scan/file/output Get one tool's raw output #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mlab-sh:mlab-sh-file-scan-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mlab-sh-file-scan-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: mlab.sh File Scan API
  version: 1.0.0
  description: 'The **mlab.sh** REST API lets you launch domain security scans, look up IP, crypto, hash, URL, email, phone and MAC intelligence, extract IOCs from raw text, analyze files and scripts, triage indicator lists, run RedKit audits, schedule scans, work on cases and inspect SSL certificates programmatically.


    All endpoints are authenticated with an API key sent in the `Authorization` header. Generate a key from **Organization → Settings → API keys** on mlab.sh. A key belongs to the organization and carries permissions chosen when it is created (`scan.lookup`, `scan.domain`, `scan.file`, `scan.batch`, `redkit`, `watchdog.read`, `watchdog.write`, `cases.read`, `cases.write`, `tags.read`, `tags.write`, `webhooks.manage`, or full access). A call outside the key''s permissions returns **403** naming the missing permission; organization and account settings are never reachable with a key. `webhooks.manage` is the one exception and is **never part of full access**: it must be ticked by name (a full-access key can hold it too). It lets a key register signed webhook endpoints and list or delete only the ones it registered itself.


    **Working through an AI agent?** Prefer the Model Context Protocol server at `https://mlab.sh/mcp` (Streamable HTTP, OAuth 2.0 or an `mcp_` token). It exposes 48 tools covering most of what is below plus CVE search, threat-actor attribution, SBOM scanning, cases and workspace memory, cluster and Proxmox inspection and offline indicator lookups that consume no scan quota, so it is a wider surface than this REST API rather than a wrapper over it. See https://doc.mlab.sh/docs/mlab.sh/integrations/mcp and https://mlab.sh/llms.txt.


    **Permissions.** Each operation lists the API key permission it needs (`x-api-key-permission`). Keys created before 2026-10-01 were migrated to full access.


    **Expiry.** A key is created with a lifetime (90 days by default; 30, 180, 365 days or never). An expired key is answered **401**, like an unknown one. The expiry date shows in Organization → Settings → API keys.


    **Quota headers.** Every call that spends scan quota answers with `X-RateLimit-Limit` (the plan''s limit for that scan type), `X-RateLimit-Remaining` (what is left after this call), `X-RateLimit-Resource` (the scan type) and `X-RateLimit-Window` (86400: quotas count a rolling 24 hours, so there is no fixed reset time). Unlimited plans send none.'
  contact:
    name: mlab.sh support
    email: contact@cyberdream.io
    url: https://mlab.sh
  license:
    name: Proprietary
  x-source-of-truth: html/openapi.json in the mlab.sh app repository, served at https://mlab.sh/openapi.json. The docs repository generates openapi.yaml from it with scripts/sync-openapi.mjs.
servers:
- url: https://mlab.sh
  description: Production
security:
- ApiKeyAuth: []
tags:
- name: File Scan
  description: Upload files and retrieve static analysis results.
paths:
  /upload/file:
    post:
      tags:
      - File Scan
      summary: Upload a file for analysis
      operationId: uploadFile
      description: 'Uploads a file (10 MB on the Free plan, 100 MB on paid plans) and launches static-analysis jobs. Use the returned `sha256` with `/api/v1/scan/file/results` to fetch results.


        **Note:** this endpoint lives at the site root (`/upload/file`), not under `/api/v1`.


        Supported types: PNG, JPG, PDF, DOCX, XLSX, PPTX, EXE, DLL, SYS.


        **API key permission:** `scan.file`.'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - file
              properties:
                file:
                  type: string
                  format: binary
                  description: The file to analyze (10 MB on the Free plan, 100 MB on paid plans).
      responses:
        '200':
          description: File accepted and jobs launched.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileUploadResponse'
              example:
                success: true
                filename: 0c2c2762-4c33-4b49-8771-be36675c8a58.png
                sha256: 5f31de7b7059acf773ba2fafcd318a2f46883d58deb9b323e74dfb20453ed3d0
                job_launched: true
                existingData: []
                existingJobs: []
        '400':
          description: Bad request (invalid content type, no file, unsupported type).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadError'
              example:
                success: false
                error:
                  code: 400
                  message: invalid_content_type
        '413':
          description: File exceeds the plan's limit (10 MB Free, 100 MB paid).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadError'
              example:
                success: false
                error:
                  code: 413
                  message: file_too_large
        '429':
          description: Quota exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadError'
              example:
                success: false
                error:
                  code: 429
                  message: rate_limited
        '403':
          $ref: '#/components/responses/Forbidden'
      x-api-key-permission: scan.file
  /api/v1/scan/file/results:
    get:
      tags:
      - File Scan
      summary: Get file analysis results
      operationId: getFileResults
      description: 'Returns file metadata and per-job analysis output. Poll until `status` is `completed`; the `analysis` array grows as jobs finish.


        **API key permission:** `scan.file`.'
      parameters:
      - name: sha256
        in: query
        required: true
        description: The `sha256` returned by the upload endpoint.
        schema:
          type: string
          example: 5f31de7b7059acf773ba2fafcd318a2f46883d58deb9b323e74dfb20453ed3d0
      responses:
        '200':
          description: File analysis results.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileResults'
              example:
                status: completed
                jobs_total: 3
                jobs_completed: 3
                file:
                  sha256: 5f31de7b7059acf773ba2fafcd318a2f46883d58deb9b323e74dfb20453ed3d0
                  md5: d41d8cd98f00b204e9800998ecf8427e
                  ssdeep: 3:tk:tk
                  filename: 0c2c2762-4c33-4b49-8771-be36675c8a58.png
                  size: 70
                  mime_type: image/png
                  created_at: '2026-07-05T16:13:54Z'
                analysis:
                - job_name: binwalk
                  end_date: '2026-07-05T16:14:04+00:00'
                  data: Analyzed 1 file for 111 file signatures (251 magic patterns) in 405.0 milliseconds
                - job_name: exiftool
                  end_date: '2026-07-05T16:14:04+00:00'
                  data: 'File Type : PNG

                    MIME Type : image/png

                    Image Width : 1

                    Image Height : 1'
                - job_name: strings
                  end_date: '2026-07-05T16:14:05+00:00'
                  data: 'IHDR

                    IDAT

                    IEND'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: No results found for this hash yet.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                example:
                  error: Not found
        '403':
          $ref: '#/components/responses/Forbidden'
      x-api-key-permission: scan.file
  /api/v1/scan/file/output:
    get:
      tags:
      - File Scan
      summary: Get one tool's raw output
      operationId: getFileToolOutput
      description: The raw output of a single analysis tool for a file, kept out of `/scan/file/results` so that summary stays light. Use a tool name listed in the results.
      parameters:
      - name: sha256
        in: query
        required: true
        description: SHA-256 of the analysed file.
        schema:
          type: string
          example: 275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f
      - name: tool
        in: query
        required: true
        description: Tool name, as listed in the file results.
        schema:
          type: string
          example: yara
      responses:
        '200':
          description: The tool output.
          content:
            application/json:
              schema:
                type: object
                properties:
                  sha256:
                    type: string
                  tool:
                    type: string
                  is_json:
                    type: boolean
                    description: When true, `output` is a JSON document serialized as a string.
                  output:
                    type: string
        '400':
          description: Missing or malformed sha256 or tool.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: No output for this file and tool.
components:
  responses:
    Unauthorized:
      description: Invalid or missing API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: error
            message: Invalid or missing API key.
    Forbidden:
      description: The API key lacks the permission this endpoint needs, or the endpoint is not open to API keys (organization and account settings never are).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: This API key does not have the 'cases.write' permission (Write cases). An owner or admin can add it in the organization settings.
  schemas:
    FileResults:
      type: object
      properties:
        status:
          type: string
          enum:
          - pending
          - in_progress
          - completed
        jobs_total:
          type: integer
        jobs_completed:
          type: integer
        file:
          type: object
          properties:
            sha256:
              type: string
            md5:
              type: string
            ssdeep:
              type: string
            filename:
              type: string
            size:
              type: integer
              format: int64
            mime_type:
              type: string
            created_at:
              type: string
              format: date-time
        analysis:
          type: array
          description: One entry per analysis job.
          items:
            type: object
            properties:
              job_name:
                type: string
                description: e.g. binwalk, exiftool, strings.
              end_date:
                type: string
              data:
                description: Decoded analysis output (string or object).
    FileUploadResponse:
      type: object
      properties:
        success:
          type: boolean
        filename:
          type: string
          description: Stored filename (UUID + extension).
        sha256:
          type: string
        job_launched:
          type: boolean
        existingData:
          type: array
          description: Prior analysis data if the file was seen before.
          items:
            type: object
        existingJobs:
          type: array
          items:
            type: object
    UploadError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
              description: 'One of `invalid_content_type`, `no_file`, `file_too_large`, `rate_limited`, `storage_error`.

                '
    Error:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Description of what went wrong.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Your API key, prefixed with `token `. Example: `Authorization: token mlab_your_api_key_here`. Each key only reaches the endpoints its permissions allow.

        '