---
title: "Prepare a multipart import upload"
method: POST
path: "/mailboxes/{id}/imports/files"
tags: ["Mailboxes"]
---

# Prepare a multipart import upload

`POST /mailboxes/{id}/imports/files`

## Request

- Base URL: `https://shipmail.to/api/v1`
- URL: `https://shipmail.to/api/v1/mailboxes/{id}/imports/files`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://shipmail.to/api/auth/oauth2/authorize`, token URL `https://shipmail.to/api/auth/oauth2/token`)

Prepare a provider-bound multipart upload for a mailbox export file up to 100 GB. Accepted files are .mbox, .mbox.gz, .zip, and .eml, plus .vcf for Google Takeout. Split the file using part_size_bytes, PUT each raw part to its matching parts[].upload_url, record each response ETag, and call completeMailboxImportUpload. Then pass file_id to createMailboxImport with the same files provider. Upload sessions expire after six days. Completed staged files that are never used are deleted after 24 hours.

## Path parameters

- `id` string, required

## Headers

- `X-Shipmail-Organization` string

## Request body

- CreateImportUploadRequest
  - `provider` 'takeout' | 'proton' | 'tuta' | 'file', required: File source provider. The staged upload can only be used by an import with this provider.
  - `file_name` string, required: Name of the export file (.mbox, .mbox.gz, .zip, or .eml; .vcf is also accepted for provider takeout).
  - `size_bytes` integer, required: File size in bytes. Up to 100 GB per file.

## Response `201`

Upload staged.

- ImportUpload
  - `object` 'import_upload', required
  - `file_id` string, required
  - `part_size_bytes` integer, required: Slice size for every part except the final part.
  - `parts` ImportUploadPart[], required
    - `part_number` integer, required
    - `upload_url` string, uri, required: Presigned URL for a raw PUT of this part. Save the ETag response header.
  - `expires_in_seconds` integer, required

## Other responses

- `404`: Resource not found.
- `422`: Validation failed.
- `429`: Rate limit exceeded.

---

[API](https://skmtc.dev/shipmail/apis/shipmail-api.md) · [All operations](https://skmtc.dev/shipmail/apis/shipmail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/shipmail/apis/shipmail-api/revisions/2c23e59d7e30?raw)
