Schedule a draft for later
const url = 'https://mail.work.optidata.cloud/api/mail/mailboxes/78/scheduled';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"draft_id":918,"scheduled_at":"2026-08-20 09:00:00","timezone":"America/Sao_Paulo"}'};
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://mail.work.optidata.cloud/api/mail/mailboxes/78/scheduled \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "draft_id": 918, "scheduled_at": "2026-08-20 09:00:00", "timezone": "America/Sao_Paulo" }'Hand a saved draft a delivery time. The moment is read in the timezone you
send and must be at least 10 minutes in the future.
Requires scheduled sending to be enabled for the tenant.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Id of the mailbox. Every mailbox the caller may use is listed in their account.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Id of the draft to deliver.
When to deliver it, read in timezone.
IANA time zone the moment is expressed in.
Examples
{ "draft_id": 918, "scheduled_at": "2026-08-20 09:00:00", "timezone": "America/Sao_Paulo"}Responses
Section titled “ Responses ”The delivery was scheduled.
A draft waiting for its delivery time.
object
When the message will be sent.
The time zone the user chose the moment in.
Where a scheduled delivery stands.
How many delivery attempts have been made.
Why the last attempt failed, when one did.
Example
{ "id": 44, "timezone": "America/Sao_Paulo", "status": "pending"}Missing, malformed or expired authentication key.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}Scheduled sending is not enabled for this tenant.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Not available"}The draft does not exist, or the moment is missing, unparseable or less than 10 minutes away.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The scheduled time must be at least 10 minutes from now.", "errors": { "scheduled_at": [ "The scheduled time must be at least 10 minutes from now." ] }}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}