{
  "openapi": {
    "info": {
      "title": "file-scan",
      "description": "Scan files to determine if they are malicious",
      "version": "2",
      "x-pangea-ui-schema": {}
    },
    "servers": [
      {
        "url": "https://file-scan.aws.us.pangea.cloud",
        "description": "Pangea regional service cluster"
      }
    ],
    "paths": {
      "/v1/scan": {
        "post": {
          "operationId": "file_scan_post_v1_scan",
          "summary": "Scan file",
          "description": "Scan a file for malicious content using the provider configured in File-Scan settings, or use the optional \u201cprovider\u201d parameter to specify the provider to be used.",
          "x-pangea-ui-schema": {
            "showExtraResponseWindow": true,
            "hideContentTypePicker": true
          },
          "requestBody": {
            "content": {
              "multipart/form-data": {
                "schema": {
                  "$id": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/paths/~1v1~1scan/requestBody/content/multipart~1form-data/schema",
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "$defs": {},
                  "required": ["request", "upload"],
                  "type": "object",
                  "properties": {
                    "request": {
                      "type": "object",
                      "properties": {
                        "verbose": {
                          "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-verbose"
                        },
                        "raw": {
                          "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-raw"
                        },
                        "provider": {
                          "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-provider"
                        },
                        "transfer_method": {
                          "description": "The transfer method used to upload the file data. [Learn more about the various Transfer Methods](/docs/api/transfer-methods).",
                          "type": "string",
                          "enum": [
                            "multipart",
                            "put-url",
                            "post-url",
                            "source-url",
                            "direct"
                          ],
                          "x-pangea-ui-schema": {
                            "default": "multipart"
                          }
                        },
                        "size": {
                          "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-size"
                        },
                        "crc32c": {
                          "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-crc32c"
                        },
                        "sha256": {
                          "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-sha256"
                        },
                        "source_url": {
                          "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-source_url"
                        }
                      },
                      "allOf": [
                        {
                          "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-require-direct"
                        },
                        {
                          "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-require-post-url"
                        },
                        {
                          "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-require-source-url"
                        }
                      ],
                      "examples": [
                        {
                          "provider": "crowdstrike",
                          "transfer_method": "multipart"
                        },
                        {
                          "provider": "crowdstrike",
                          "transfer_method": "post-url",
                          "size": 12,
                          "sha256": "4ef5bd7188ca4d5eeccdcf9e4090fdfeb22f58befe473536b2e5d99506007080",
                          "crc32c": "1234abcd"
                        }
                      ],
                      "x-pangea-ui-schema": {
                        "loadSampleData": false
                      },
                      "additionalProperties": false
                    },
                    "upload": {}
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verbose": {
                      "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-verbose"
                    },
                    "raw": {
                      "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-raw"
                    },
                    "provider": {
                      "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-provider"
                    },
                    "transfer_method": {
                      "description": "The transfer method used to upload the file data. [Learn more about the various Transfer Methods](/docs/api/transfer-methods).",
                      "type": "string",
                      "enum": [
                        "multipart",
                        "put-url",
                        "post-url",
                        "source-url",
                        "direct"
                      ],
                      "x-pangea-ui-schema": {
                        "default": "source-url"
                      }
                    },
                    "size": {
                      "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-size"
                    },
                    "crc32c": {
                      "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-crc32c"
                    },
                    "sha256": {
                      "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-sha256"
                    },
                    "source_url": {
                      "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-field-source_url"
                    }
                  },
                  "allOf": [
                    {
                      "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-require-direct"
                    },
                    {
                      "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-require-post-url"
                    },
                    {
                      "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/api-v1-file-scan-require-source-url"
                    }
                  ],
                  "examples": [
                    {
                      "provider": "crowdstrike",
                      "transfer_method": "multipart"
                    },
                    {
                      "provider": "crowdstrike",
                      "transfer_method": "post-url",
                      "size": 12,
                      "sha256": "4ef5bd7188ca4d5eeccdcf9e4090fdfeb22f58befe473536b2e5d99506007080",
                      "crc32c": "1234abcd"
                    }
                  ],
                  "x-pangea-ui-schema": {
                    "loadSampleData": false
                  },
                  "additionalProperties": false,
                  "$id": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/paths/~1v1~1scan/requestBody/content/application~1json/schema"
                }
              }
            }
          },
          "responses": {
            "200": {
              "content": {
                "application/json": {
                  "schema": {
                    "$id": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/paths/~1v1~1scan/responses/200/content/application~1json/schema",
                    "$schema": "https://json-schema.org/draft/2020-12/schema",
                    "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/pangea-response",
                    "$defs": {},
                    "properties": {
                      "result": {
                        "type": "object",
                        "properties": {
                          "data": {
                            "description": "High-level normalized results sent by the Pangea service",
                            "type": "object",
                            "properties": {
                              "category": {
                                "type": "array",
                                "description": "The categories that apply to this indicator as determined by the provider",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "score": {
                                "type": "integer",
                                "description": "The score, given by the Pangea service, for the indicator"
                              },
                              "verdict": {
                                "type": "string",
                                "enum": [
                                  "malicious",
                                  "suspicious",
                                  "unknown",
                                  "benign"
                                ],
                                "description": "The verdict, given by the Pangea service, for the indicator"
                              }
                            }
                          },
                          "parameters": {
                            "type": "object",
                            "description": "The parameters, which were passed in the request, echoed back",
                            "properties": {}
                          },
                          "raw_data": {
                            "type": "object",
                            "description": "The raw data from the provider. Each provider's data will have its own format",
                            "properties": {}
                          }
                        },
                        "examples": [
                          {
                            "data": {
                              "category": ["Text.Format.EICAR"],
                              "score": 100,
                              "verdict": "malicious"
                            },
                            "parameters": {
                              "verbose": true,
                              "raw": true,
                              "provider": "crowdstrike"
                            },
                            "raw_data": {
                              "reputation": {},
                              "scan": {
                                "ArchiveInfo": {
                                  "clean_files": 0,
                                  "dirty_files": 0,
                                  "errors": 0,
                                  "files_scanned": 0,
                                  "potentially_unwanted_files": 0
                                },
                                "confidence": "not applicable",
                                "detection_name": "",
                                "prediction": "clean"
                              }
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              },
              "description": "No description provided"
            },
            "400": {
              "description": "Validation errors",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/pangea-validation-errors"
                  }
                }
              }
            }
          }
        }
      }
    },
    "openapi": "3.1.0",
    "components": {
      "schemas": {
        "pangea-response": {
          "title": "Response Schema",
          "description": "Pangea standard response schema",
          "type": "object",
          "required": ["request_id", "request_time", "response_time", "status"],
          "properties": {
            "request_id": {
              "type": "string",
              "description": "A unique identifier assigned to each request made to the API. It is used to track and identify a specific request and its associated data. The `request_id` can be helpful for troubleshooting, auditing, and tracing the flow of requests within the system. It allows users to reference and retrieve information related to a particular request, such as the response, parameters, and raw data associated with that specific request.\n\n```\n\"request_id\":\"prq_x6fdiizbon6j3bsdvnpmwxsz2aan7fqd\"\n```"
            },
            "request_time": {
              "type": "string",
              "description": "The timestamp indicates the exact moment when a request is made to the API. It represents the date and time at which the request was initiated by the client. The `request_time` is useful for tracking and analyzing the timing of requests, measuring response times, and monitoring performance metrics. It allows users to determine the duration between the request initiation and the corresponding response, aiding in the assessment of API performance and latency.\n\n```\n\"request_time\":\"2022-09-21T17:24:33.105Z\"\n```"
            },
            "response_time": {
              "type": "string",
              "description": "Duration it takes for the API to process a request and generate a response. It represents the elapsed time from when the request is received by the API to when the corresponding response is returned to the client.\n\n```\n\"response_time\":\"2022-09-21T17:24:34.007Z\"\n```"
            },
            "status": {
              "type": "string",
              "description": "It represents the status or outcome of the API request made for IP information. It indicates the current state or condition of the request and provides information on the success or failure of the request.\n\n```\n\"status\":\"success\"\n```"
            },
            "summary": {
              "type": "string",
              "description": "Provides a concise and brief overview of the purpose or primary objective of the API endpoint. It serves as a high-level summary or description of the functionality or feature offered by the endpoint."
            },
            "result": {
              "type": "object"
            }
          },
          "examples": [
            {
              "request_id": "prq_x6fdiizbon6j3bsdvnpmwxsz2aan7fqd",
              "request_time": "2022-09-21T17:24:33.105Z",
              "response_time": "2022-09-21T17:24:34.007Z",
              "status": "success"
            }
          ],
          "$id": "https://pangea.cloud/docs/openapi/file-scan_openapi.json#/components/schemas/pangea-response"
        },
        "pangea-validation-errors": {
          "$ref": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json#/components/schemas/pangea-response",
          "required": ["result"],
          "properties": {
            "result": {
              "type": "object",
              "required": ["errors"],
              "properties": {
                "errors": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "object",
                    "required": ["code", "detail", "source"],
                    "properties": {
                      "code": {
                        "type": "string",
                        "enum": [
                          "FieldRequired",
                          "InvalidString",
                          "InvalidNumber",
                          "InvalidInteger",
                          "InvalidObject",
                          "InvalidArray",
                          "InvalidNull",
                          "InvalidBool",
                          "BadFormat",
                          "BadFormatPangeaDuration",
                          "BadFormatDateTime",
                          "BadFormatTime",
                          "BadFormatDate",
                          "BadFormatEmail",
                          "BadFormatHostname",
                          "BadFormatIPv4",
                          "BadFormatIPv6",
                          "BadFormatIPAddress",
                          "BadFormatUUID",
                          "BadFormatURI",
                          "BadFormatURIReference",
                          "BadFormatIRI",
                          "BadFormatIRIReference",
                          "BadFormatJSONPointer",
                          "BadFormatRelativeJSONPointer",
                          "BadFormatRegex",
                          "BadFormatJSONPath",
                          "BadFormatBase64",
                          "DoesNotMatchPattern",
                          "DoesNotMatchPatternProperties",
                          "NotEnumMember",
                          "AboveMaxLength",
                          "BelowMinLength",
                          "AboveMaxItems",
                          "BelowMinItems",
                          "NotMultipleOf",
                          "NotWithinRange",
                          "UnexpectedProperty",
                          "InvalidPropertyName",
                          "AboveMaxProperties",
                          "BelowMinProperties",
                          "NotContains",
                          "ContainsTooMany",
                          "ContainsTooFew",
                          "ItemNotUnique",
                          "UnexpectedAdditionalItem",
                          "InvalidConst",
                          "IsDependentOn",
                          "IsTooBig",
                          "IsTooSmall",
                          "ShouldNotBeValid",
                          "NoUnevaluatedItems",
                          "NoUnevaluatedProperties",
                          "DoesNotExist",
                          "IsReadOnly",
                          "CannotAddToDefault",
                          "MustProvideOne",
                          "MutuallyExclusive",
                          "BadState",
                          "InaccessibleURI",
                          "ProviderDisabled",
                          "ConfigProjectMismatch",
                          "ConfigServiceMismatch",
                          "ConfigNotExist"
                        ]
                      },
                      "detail": {
                        "type": "string",
                        "description": "Human readable description of the error"
                      },
                      "source": {
                        "type": "string",
                        "description": "Path to the data source of the error",
                        "format": "json-pointer"
                      },
                      "path": {
                        "type": "string",
                        "description": "The Schema path where the error occurred",
                        "format": "json-pointer"
                      }
                    }
                  }
                }
              }
            }
          },
          "$id": "https://pangea.cloud/docs/openapi/file-scan_openapi.json#/components/schemas/pangea-validation-errors"
        },
        "v1_file_scan": {
          "type": "object",
          "properties": {
            "verbose": {
              "type": "boolean",
              "default": false,
              "examples": [true],
              "description": "Echo the API parameters in the response."
            },
            "raw": {
              "type": "boolean",
              "default": false,
              "examples": [true],
              "description": "Include raw data from this provider."
            },
            "provider": {
              "type": "string",
              "enum": ["crowdstrike"],
              "examples": ["crowdstrike"],
              "description": "Scan file using this provider."
            }
          },
          "examples": [
            {
              "provider": "crowdstrike"
            }
          ],
          "$id": "https://pangea.cloud/docs/openapi/file-scan_openapi.json#/components/schemas/v1_file_scan"
        },
        "api-v1-file-scan-field-verbose": {
          "type": "boolean",
          "default": false,
          "examples": [true],
          "description": "Echo the API parameters in the response.",
          "$id": "https://pangea.cloud/docs/openapi/file-scan_openapi.json#/components/schemas/api-v1-file-scan-field-verbose"
        },
        "api-v1-file-scan-field-raw": {
          "type": "boolean",
          "default": false,
          "examples": [true],
          "description": "Include raw data from this provider.",
          "$id": "https://pangea.cloud/docs/openapi/file-scan_openapi.json#/components/schemas/api-v1-file-scan-field-raw"
        },
        "api-v1-file-scan-field-provider": {
          "type": "string",
          "enum": ["crowdstrike", "reversinglabs"],
          "examples": ["crowdstrike"],
          "description": "Scan file using this provider.",
          "$id": "https://pangea.cloud/docs/openapi/file-scan_openapi.json#/components/schemas/api-v1-file-scan-field-provider"
        },
        "api-v1-file-scan-field-size": {
          "type": "number",
          "description": "The size (in bytes) of the file. If the upload doesn't match, the call will fail.",
          "$id": "https://pangea.cloud/docs/openapi/file-scan_openapi.json#/components/schemas/api-v1-file-scan-field-size"
        },
        "api-v1-file-scan-field-crc32c": {
          "description": "The CRC32C hash of the file data, which will be verified by the server if provided.",
          "type": "string",
          "contentEncoding": "base64",
          "$id": "https://pangea.cloud/docs/openapi/file-scan_openapi.json#/components/schemas/api-v1-file-scan-field-crc32c"
        },
        "api-v1-file-scan-field-sha256": {
          "type": "string",
          "pattern": "^[0123456789abcdef]{64}$",
          "description": "The hexadecimal-encoded SHA256 hash of the file data, which will be verified by the server if provided.",
          "$id": "https://pangea.cloud/docs/openapi/file-scan_openapi.json#/components/schemas/api-v1-file-scan-field-sha256"
        },
        "api-v1-file-scan-field-source_url": {
          "type": "string",
          "format": "uri",
          "description": "A URL where the file to be scanned can be downloaded. Required if `transfer_method` is set to `source-url`",
          "$id": "https://pangea.cloud/docs/openapi/file-scan_openapi.json#/components/schemas/api-v1-file-scan-field-source_url"
        },
        "api-v1-file-scan-require-direct": {
          "if": {
            "properties": {
              "transfer_method": {
                "const": "direct"
              }
            },
            "required": ["transfer_method"]
          },
          "then": {
            "required": ["sha256", "crc32c", "size"]
          },
          "$id": "https://pangea.cloud/docs/openapi/file-scan_openapi.json#/components/schemas/api-v1-file-scan-require-direct"
        },
        "api-v1-file-scan-require-post-url": {
          "if": {
            "properties": {
              "transfer_method": {
                "const": "post-url"
              }
            },
            "required": ["transfer_method"]
          },
          "then": {
            "required": ["sha256", "crc32c", "size"]
          },
          "$id": "https://pangea.cloud/docs/openapi/file-scan_openapi.json#/components/schemas/api-v1-file-scan-require-post-url"
        },
        "api-v1-file-scan-require-source-url": {
          "if": {
            "properties": {
              "transfer_method": {
                "const": "source-url"
              }
            },
            "required": ["transfer_method"]
          },
          "then": {
            "required": ["source_url"]
          },
          "$id": "https://pangea.cloud/docs/openapi/file-scan_openapi.json#/components/schemas/api-v1-file-scan-require-source-url"
        }
      },
      "securitySchemes": {
        "APIToken": {
          "type": "http",
          "bearerFormat": "token",
          "description": "Pangea API Token",
          "scheme": "bearer"
        }
      }
    },
    "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema"
  },
  "remoteDocuments": {},
  "url": "https://file-scan.aws.us.pangea.cloud/v1/openapi.json"
}
