---
title: "Upload spreadsheet file"
method: POST
path: "/upload"
tags: ["Upload"]
---

# Upload spreadsheet file

`POST /upload`

## Request

- Base URL: `http://localhost:3000`
- URL: `http://localhost:3000/upload`
- Auth: one of:
  - API key in cookie `session`
  - API key in header `X-CSRF-Token`

Upload a spreadsheet file for processing via CDP Uploader service.

The file will be:
1. Uploaded to CDP Uploader staging area
2. Scanned for viruses
3. If clean, automatically transferred to Azure Blob Storage

Filenames are automatically timestamped: `{original-name}_{timestamp}.{ext}`

## Request body `multipart/form-data`

- object
  - `file` string, binary, required: Spreadsheet file to upload (CSV, XLS, XLSX, ODS, XLSM, XLSB)

## Response `201`

File uploaded successfully

- UploadSuccessResponse
  - `success` boolean, required
  - `uploadId` string, uuid, required: Unique identifier for this upload
  - `filename` string, required: Timestamped filename stored in system
  - `originalFilename` string: Original filename from user
  - `timestamp` string, date-time: Upload timestamp (ISO 8601)
  - `message` string, required

## Other responses

- `400`: Bad request - invalid input
- `413`: File size exceeds maximum allowed (50MB)
- `415`: Unsupported file type
- `500`: Internal server error

---

[API](https://skmtc.dev/defra/apis/apha-surveillance-data-submission-portal-api.md) - [All operations](https://skmtc.dev/defra/apis/apha-surveillance-data-submission-portal-api/llms.txt) - [OpenAPI document](https://skmtc.dev/defra/apis/apha-surveillance-data-submission-portal-api/revisions/592deaf8edd7?raw)
