---
title: "Submit form with file upload"
method: POST
path: "/upload/form-submission"
tags: ["Forms", "Upload"]
---

# Submit form with file upload

`POST /upload/form-submission`

## Request

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

Handle form submission with optional file upload.
Processes both form data and file attachment.

## Request body `multipart/form-data`

- object
  - `file` string, binary: Optional spreadsheet file
  - `formData` object: Form submission data
    - `formId` string: Form identifier
    - `submissionId` string: Submission identifier

## Response `200`

Form submitted successfully (no file)

- object
  - `success` boolean
  - `formSubmissionId` string, uuid
  - `message` string

## Other responses

- `201`: Form with file submitted successfully
- `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)
