Create a mail history upload
Creates a presigned archive upload for an existing mailbox.
POST
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.
apiKeyheader
x-api-key<token>id*stringMatch
^mbx_[0-9a-hjkmnp-tv-z]{16,24}$application/json- body
importId?|nullfilename*stringLength
1 <= length <= 255sizeBytes*integerRange
0 < value <= 5000000000format*stringValue in
"gmail""apple""mbox"mailboxPath?|nullSuccess
application/json- response
id*stringuploadUrl*stringimport { 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"
}