> ## Documentation Index
> Fetch the complete documentation index at: https://docs.threatbook.io/llms.txt
> Use this file to discover all available pages before exploring further.

# File Upload

> For potentially malicious files from office endpoints, Web/FTP/email attachments, or suspicious files on endpoints/servers, the system performs rapid detection using **22 antivirus scanning engines**. Based on the file type, the system automatically selects an appropriate sandbox environment for dynamic analysis.



## OpenAPI

````yaml api-reference/enrichment/file-upload-v2.openapi.json POST /v2/file/upload
openapi: 3.1.0
info:
  title: File Upload（V2）
  description: >-
    For potentially malicious files from office endpoints, Web/FTP/email
    attachments, or suspicious files on endpoints/servers, the system performs
    rapid detection using **22 antivirus scanning engines**. Based on the file
    type, the system automatically selects an appropriate sandbox environment
    for dynamic analysis.
  version: 1.0.0
servers:
  - url: https://api.threatbook.io
security: []
paths:
  /v2/file/upload:
    post:
      tags: []
      summary: File Upload（V2）
      description: >-
        For potentially malicious files from office endpoints, Web/FTP/email
        attachments, or suspicious files on endpoints/servers, the system
        performs rapid detection using **22 antivirus scanning engines**. Based
        on the file type, the system automatically selects an appropriate
        sandbox environment for dynamic analysis.
      parameters:
        - name: apikey
          in: query
          description: >-
            Your API key. For details on how to obtain and manage your API key,
            please refer to the
            [Authentication](https://docs.threatbook.io/api-reference/authentication)
            page.


            **Kindly note:**


            Please check if you have bound your access IP to the key and have
            the authority quotas to access this API before you interact with it.
          required: true
          schema:
            type: string
        - name: sandbox_type
          in: query
          description: >-
            **Sandbox Execution Environment**  

            Users can specify the sandbox environment in which the file will be
            executed.


            Available environments include:  


            - **Windows**:  
              - win7_sp1_enx64_office2013  
              - win7_sp1_enx86_office2013  
              - win7_sp1_enx86_office2010  
              - win7_sp1_enx86_office2007  
              - win7_sp1_enx86_office2003  
              - win10_1903_enx64_office2016  

            - **Linux**:  
              - ubuntu_1704_x64  
              - centos_7_x64  

            - **Kylin**:  
              - kylin_desktop_v10  
          required: false
          schema:
            type: string
        - name: run_time
          in: query
          description: >
            The sandbox execution time is **60s by default** and can be adjusted
            as needed, up to a maximum of **300s**.
          required: false
          schema:
            type: integer
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: |
                    Files to be analyzed must be no larger than **100 MB**.

                    - **Note:** Do not upload files exceeding 100 MB.
                    - **Supported file types** include:  
                      PE executables (EXE, DLL, COM, etc.), Office documents (DOC, XLS, PPT, etc.), PDF, HTML, script files, MSI, SWF, JAR, LNK, ELF, and various archive formats (ZIP, RAR, 7Z, etc.).
              required:
                - file
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      sha256:
                        type: string
                        description: '**File Hash**'
                      permalink:
                        type: string
                        description: '**ATI File Details Page URL**'
                    required:
                      - sha256
                      - permalink
                  response_code:
                    type: integer
                  msg:
                    type: string
                required:
                  - data
                  - response_code
                  - msg
              example:
                data:
                  sha256: >-
                    d79c9643d76062f553f76bb20b07da88fdbf5ddf3428ffc0223bb7bf90e36deb
                  permalink: >-
                    https://ati.threatbook.io/hash/d79c9643d76062f553f76bb20b07da88fdbf5ddf3428ffc0223bb7bf90e36deb
                response_code: 200
                msg: Success
          headers: {}
        '202':
          description: ''
          content:
            application/json:
              schema:
                title: ''
                type: object
                properties:
                  msg:
                    type: string
                    enum:
                      - ' In Progress'
                  response_code:
                    type: integer
                    const: 202
                required:
                  - msg
                  - response_code
              examples:
                Example 1:
                  summary: Example 1
                  value:
                    msg: ' In Progress'
                    response_code: 202
        '206':
          description: >-
            The file was uploaded successfully, but only partial analysis could
            be completed because of a quota limitation.
          content:
            application/json:
              schema:
                title: ''
                type: object
                properties:
                  msg:
                    type: string
                  response_code:
                    type: integer
                    const: 206
                required:
                  - msg
                  - response_code
              examples:
                Example 1:
                  summary: Example 1
                  value:
                    msg: >-
                      The file was uploaded successfully, but only partial
                      analysis could be completed because of the
                      {rate/daily/monthly/total quota} limitation.
                    response_code: 206
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  msg:
                    type: string
                    enum:
                      - Required:{resource/apikey}
                      - Invalid parameter:{parameter}
                  response_code:
                    type: integer
                    const: 400
                required:
                  - msg
                  - response_code
              examples:
                Example 1:
                  summary: Example 1
                  value:
                    msg: Required:{resource/apikey}
                    response_code: 400
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  msg:
                    type: string
                    enum:
                      - Invalid account status
                      - 'Invalid access IP: {actual IP address}'
                      - Invalid API key
                      - Invalid key status
                      - No access to the API
                      - Expired API key
                      - No access to the requested resource
                      - 'No access to: {parameter}'
                  response_code:
                    type: integer
                    const: 401
                required:
                  - msg
                  - response_code
              examples:
                Example 1:
                  summary: Example 1
                  value:
                    msg: Invalid account status
                    response_code: 401
        '405':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  msg:
                    type: string
                    const: Invalid API method
                  response_code:
                    type: integer
                    const: 405
                required:
                  - msg
                  - response_code
              examples:
                Example 1:
                  summary: Example 1
                  value:
                    msg: Invalid API method
                    response_code: 405
        '429':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  msg:
                    type: string
                    enum:
                      - Request rate limitation
                      - Beyond {daily/monthly/total} quotas limitation
                  response_code:
                    type: integer
                    const: 429
                required:
                  - msg
                  - response_code
              examples:
                Example 1:
                  summary: Example 1
                  value:
                    msg: Request rate limitation
                    response_code: 429
        '500':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  msg:
                    type: string
                    enum:
                      - System error
                      - URL Download Fail
                  response_code:
                    type: integer
                    const: 500
                required:
                  - msg
                  - response_code
              examples:
                Example 1:
                  summary: Example 1
                  value:
                    msg: System error
                    response_code: 500
      deprecated: false
      security: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.