---
title: "POST call to scan file for virus, and persist to disk (optional)"
method: POST
path: "/v1/scan/upload"
tags: ["scan and persist"]
---

# POST call to scan file for virus, and persist to disk (optional)

`POST /v1/scan/upload`

## Request

- Base URL: `https://localhost:8080`
- URL: `https://localhost:8080/v1/scan/upload`
- Auth: none declared

this endpoint is called to scan file for virus and persist it in AWS s3 (optional)

## Request body `multipart/form-data`

- object
  - `meta` ServiceRequestObject, required
    - `id` string, required: id
    - `fileName` string: file name
    - `mime` string: file type
    - `sizeKb` integer: file size in KB
    - `checksum` string: MD5 file checksum
    - `persist` boolean: persit file
  - `file` string, binary, required: file to be uploaded

## Response `200`

no virus detected and file upload to S3 bucket

- FileUploadResponse
  - `s3Ref` string: S3 file key
  - `bucket` string: bucket name
  - `fileSizeKb` integer: unencrypted file size in kb

## Other responses

- `400`: BAD REQUEST - badly formed JSON or duplicate entry
- `406`: NOT ACCEPTABLE - virus detected in the file or file is password protected
- `500`: INTERNAL SERVER ERROR - an unknown internal error occurred

---

[API](https://skmtc.dev/department-for-work-and-pensions/apis/dwp-file-upload-service-pip.md) - [All operations](https://skmtc.dev/department-for-work-and-pensions/apis/dwp-file-upload-service-pip/llms.txt) - [OpenAPI document](https://skmtc.dev/department-for-work-and-pensions/apis/dwp-file-upload-service-pip/revisions/01eb8e8bf8c1?raw)
