---
title: "Create fileUpload"
method: POST
path: "/fileUploads"
tags: ["fileUploads"]
---

# Create fileUpload

`POST /fileUploads`

There are two ways to upload a file, base64 and multipart. <br/>
For base64, you will need to describe the fields name, extension, patient, content-type, type and the image converted to base64. You can see a request example on the right side. <br/>
For multipart: you will have to create an HTML form, with an input field type "file" named "file", as well as the other required fields, and submit the form <br/>

## Request body

- FileUploadRequest
  - `bucket` string — AWS Bucket S3 name.
  - `aswId` string — Asw Id.
  - `name` string, required — Name of file.
  - `extension` string, required — Extension of file.
  - `contentType` string, required — Content Type/MIME of file.
  - `type` 'patient-insurance-image' | 'patient-message' | 'patient-referral-fax' | 'patient-referral' | 'patient-form' | 'provider-headshot' | 'avatar' | 'custom-web-style-logo' | 'generic' | 'integration-archive' | 'patient-pdf' | 'patient-ccda' | 'bulk-patients-insurance' | 'bulk-patients-form' | 'do-not-contact-patients-list' | 'archived-contacts-list' | 'bulk-users-update' | 'bulk-users-create' | 'upload' | 'lumabot-html-preview', required — Type of the uploaded file
  - `base64` string, required — base64 representation of the binary file.
  - `patient` string — ID of a Patient.
  - `insurance` string — ID of an Insurance.
  - `referral` string — ID of a Referral.
  - `outboundReferral` string — ID of an Outbound Referral.
  - `patientForm` string — ID of a Patient Form.
  - `message` string — ID of a Message.
  - `broadcast` string — ID of a Broadcast.
  - `website` string — Website.
  - `status` 'processing' | 'completed' | 'failed' — Status of the file upload. Processing = File-upload was created, but still being processed, Completed = File-upload was completed successfully, Failed = File-upload has failed.
  - `estimate` string — ID of an estimate.

## Response `201`

Successful creation

- FileUploadResponse — A FileUpload represents a file uploaded to the Luma Health platform, such as a patient insurance card image, a referral fax, a form attachment, a chat attachment, or a provider headshot. It stores metadata about the file including its storage location, name, extension, content type, upload type, and processing status, and it can link back to related records like a patient, insurance, referral, patient form, message, or estimate. Staff and integrations use this resource to check on an uploaded file's metadata and confirm whether processing completed successfully or failed.
  - `_id` string — Luma's internal ID of an object.
  - `user` string — The ID of the root account user.
  - `deleted` 0 | 1 — Flag for logical deletion where 1 means deleted.
  - `createdBy` string — The ID of the user who created this object.
  - `updatedBy` string — The ID of the user who updated this object.
  - `createdAt` string, date-time — The date/time when this object was created.
  - `updatedAt` string, date-time — The date/time when this object was updated.
  - `bucket` string — AWS Bucket S3 name.
  - `aswId` string — Asw Id.
  - `name` string — Name of file.
  - `extension` string — Extension of file.
  - `contentType` string — Content Type/MIME of file.
  - `type` 'patient-insurance-image' | 'patient-message' | 'patient-referral-fax' | 'patient-referral' | 'patient-form' | 'provider-headshot' | 'avatar' | 'custom-web-style-logo' | 'generic' | 'integration-archive' | 'patient-pdf' | 'patient-ccda' | 'bulk-patients-insurance' | 'bulk-patients-form' | 'do-not-contact-patients-list' | 'archived-contacts-list' | 'bulk-users-update' | 'bulk-users-create' | 'upload' | 'lumabot-html-preview' — Type of the uploaded file.
  - `base64` string — base64 representation of the binary file.
  - `patient` string — ID of a Patient.
  - `insurance` string — ID of an Insurance.
  - `referral` string — ID of a Referral.
  - `outboundReferral` string — ID of an Outbound Referral.
  - `patientForm` string — ID of a Patient Form.
  - `message` string — ID of a Message.
  - `broadcast` string — ID of a Broadcast.
  - `website` string — ID of a Website.
  - `status` 'processing' | 'completed' | 'failed' — Status of the file upload. Processing = File-upload was created, but still being processed, Completed = File-upload was completed successfully, Failed = File-upload has failed.
  - `estimate` string — Estimate Id.

## Other responses

- `401` — Not authenticated
- `403` — Access token does not have the required scope
- `default` — Unexpected error

---

[API](https://skmtc.net/lumahealth/apis/rest-service.md) · [All operations](https://skmtc.net/lumahealth/apis/rest-service/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lumahealth/rest-service/revisions/d3c75c2a2f1d/schema)
