Prepare Bulk CSV Upload
const url = 'https://api.unwrap.email/v1/emails/bulk/upload';const options = { method: 'POST', headers: { 'UNWRAP-EMAIL-API-TOKEN': '<UNWRAP-EMAIL-API-TOKEN>', 'Content-Type': 'application/json' }, body: '{"filename":"example","size_bytes":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.unwrap.email/v1/emails/bulk/upload \ --header 'Content-Type: application/json' \ --header 'UNWRAP-EMAIL-API-TOKEN: <UNWRAP-EMAIL-API-TOKEN>' \ --data '{ "filename": "example", "size_bytes": 1 }'Prepare an immutable CSV upload of at most 50 MiB. Requires write authentication, an active subscription, and CSV admission. PUT the exact bytes to upload_url with the returned headers within 15 minutes. Submit upload_id to POST /emails/bulk within one hour. At most three unclaimed uploads are allowed. Idempotency-Key is scoped separately from bulk submission; matching preparation retries refresh the signature within the original one-hour window.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “ Header Parameters ”Request Body required
Section titled “ Request Body required ”object
Original CSV filename, without a directory.
Exact UTF-8 file size, at most 50 MiB.
Example generated
{ "filename": "example", "size_bytes": 1}Responses
Section titled “ Responses ”Prepared upload and required signed headers.
object
object
Example
{ "headers": { "Content-Type": "text/csv", "If-None-Match": "*" }}Invalid request envelope, pagination, identifier, or header.
Valid API authentication is required; submission requires write permission.
API-token access requires an active subscription. Submission also requires an active subscription for session and bearer callers.
The job does not exist or belongs to another user.
Idempotency-Key input mismatch, or CSV is not ready.
Job results have expired.
Request body exceeds 5 MiB.
Three unfinished submissions or unclaimed uploads already exist for this user.
Bulk admission is disabled or storage is temporarily unavailable.