---
title: "Upload File"
method: POST
path: "/files"
tags: ["Files"]
---

# Upload File

`POST /files`

Uploads selected file to the server. Required Access Level: ModifyFiles

## Query parameters

- `expiresAfterDays` integer, nullable — integer

## Request body

- FilePayload
  - `BinaryContent` string, byte, required — Content of the file sent as binary data
  - `Name` string, string — Filename
  - `ContentType` string, string — Type of file's content (e.g. image/jpeg)

## Response `201`

Created

- FileInfo — File information
  - `FileName` string, string — Name of your file including extension.
  - `Size` integer, nullable — Size of your attachment (in bytes).
  - `DateAdded` string, date-time — Date of creation in YYYY-MM-DDThh:ii:ss format
  - `ExpirationDate` string, date-time, nullable — Date when the file will be deleted from your Account.
  - `ContentType` string, string — Content type of the file.

---

[API](https://skmtc.net/elasticemail/apis/megamail-api.md) · [All operations](https://skmtc.net/elasticemail/apis/megamail-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elasticemail/megamail-api/versions/1a0ebb83f676/schema)
