Skip to Content

Create a mail history upload

Creates a presigned archive upload for an existing mailbox.

POST
/v1/mailboxes/{id}/imports/uploads

Creates a presigned archive upload for an existing mailbox. Pass importId to append another archive to the same queued job; each upload gets its own URL. Upload each URL with Content-Type application/mbox and Content-Length equal to its accepted sizeBytes. Upload every archive before starting the job. Apple Mail package directories are traversed by the CLI into one import.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^mbx_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json
  1. body
importId?|null
filename*string
Length1 <= length <= 255
sizeBytes*integer
Range0 < value <= 5000000000
format*string
Value in"gmail""apple""mbox"
mailboxPath?|null

Response Body

Success

application/json
  1. response
id*string
uploadUrl*string
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.mailboxes.createImportUpload({
  "id": "example",
  "filename": "example",
  "sizeBytes": 1,
  "format": "gmail"
});
Example Response
{
  "id": "string",
  "uploadUrl": "string"
}

Related documentation