Receive Emails: Schedule

Schedule Send

Write the email now and send it later. It waits in the Scheduled folder until the time you pick.

POSThttps://g.sendcorex.com/v1command: schedule_send
i

Everything that can be checked is checked now (recipient, subject, original email, attachments), so you find out before the time comes. Credits and the daily limit are checked when it sends.

i

If the send is refused at that time (no credits, daily limit, spam), nothing is lost: the email goes back to Drafts with the reason.

i

Recipients who refused tracking on the preferences page are never tracked, even with true.

i

Emails sent from the mailbox carry no List-Unsubscribe header or unsubscribe link unless you send unsubscribe: true, because they are personal emails.

i

Everyone who receives an email from the mailbox becomes a contact in the account’s “Webmail” list and is trusted in this mailbox: their replies go to the Inbox and the address shows up in autocomplete. Senders the mailbox blocked stay blocked.

i

With unsubscribe: true, recipients who already unsubscribed from this mailbox are refused with RECIPIENT_UNSUBSCRIBED, and recipients lists them. Replies are never blocked.

Arguments

  • send_atstringrequired

    RFC 3339, YYYY-MM-DD or epoch ms. At least 1 minute from now and up to 1 year.

  • modestringoptional

    new (default), reply or forward.

  • idstringoptional

    The original message, for reply and forward.

  • tostring | string[]optional

    Recipient. Required for new and forward. For new it can be an array of up to 30 (paid plans).

  • ccstring[]optional

    Visible copies.

  • bccstring[]optional

    Hidden copies.

  • subjectstringoptional

    Required for new. Reply and forward default to Re: / Fwd: original.

  • htmlstringoptional

    HTML body. Or text, or template_id.

  • template_idstringoptional

    Fill the body (and the subject of a new email) from a template.

  • followup_after_hoursnumberoptional

    Remind you if nobody replies this many hours after it is sent.

  • scheduled_idstringoptional

    Reschedule: the old scheduled email is replaced.

  • attachmentsobject[]optional

    Files to attach: [{ file_name, content, content_type }], content in base64. Up to 20 files and 25 MB in total. Every file is scanned; a dangerous one fails with FILE_BLOCKED.

  • compose_uidstringoptional

    Attachments you uploaded before with upload_attachment.

  • attachment_idsstring[]optional

    Which of the uploaded attachments to send. Without it, all of them.

  • track_opensbooleanoptional

    Track when each recipient opens the email (invisible pixel). Default true.

  • track_clicksbooleanoptional

    Track clicks on the links (each link goes through a redirect). Default true.

  • unsubscribebooleanoptional

    Add an unsubscribe link. Put [unsubscribe] in the body (as a link href or as plain text) where the link should go; without it, a default line is added at the end. Default false.

  • audiencestringoptional

    Send to an audience instead of addresses: subscribed, opened, clicked, both, seg:<segment_id> or msg:<message_uid>:opened|clicked|not_opened. to becomes optional. Up to 5,000 people. The unsubscribe link is turned on and the email goes out as marketing. Paid plans.

  • best_timebooleanoptional

    Send each person at the hour they usually open or click, during the day of send_at. Needs audience and mode: new. send_at is 00:00 of that day in your timezone, as UTC.

  • best_fallback_atstring | numberoptional

    Time for people with no history (RFC 3339 or epoch ms). Must be on the same day as send_at.

Quick start

import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1',
  {
    commands: [
      {
        command: "schedule_send",
        args: {
          to: "ana@client.com",
          subject: "Proposal",
          html: "<p>Hi Ana, here is the proposal.</p>",
          send_at: "2026-10-27T09:00:00+08:00"
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_TOKEN } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);

Response

{
  "type": "SUCCESS",
  "results": [
    {
      "command": "schedule_send",
      "id": "0",
      "type": "SUCCESS",
      "data": {
        "scheduled_id": "Vj0xQUJDMTIz",
        "thread_id": "thr_9a1c4e72",
        "send_at": "2026-10-27T01:00:00Z"
      }
    }
  ]
}

Response fields

  • scheduled_id

    The message in Scheduled. Use it to cancel, reschedule or send now.

List what is scheduled

The scheduled emails are in the Scheduled folder, ordered by send time.

Request body

{
  "commands": [
    {
      "command": "list_messages",
      "args": {
        "folder": "Scheduled"
      }
    }
  ]
}

Errors

HTTP-level errors return type, code and message. Errors marked CMD come back inside the command result, with HTTP 200.

  • 401TOKEN_EXPIRED

    The access token has expired. Call Refresh Token and repeat the request.

  • 401INVALID_TOKEN

    The token is malformed, unknown or revoked.

  • 429RATE_LIMITED

    More than 15 requests/s or 15 in flight for the same IP + mailbox. Wait the number of seconds in Retry-After.

  • CMDINVALID_AUDIENCE

    The audience is not valid: unknown group, a segment of another mailbox or a message this mailbox didn’t send.

  • CMDAUDIENCE_OVER_LIMIT

    The audience has more people than you can send to (up to 5,000 per email and your daily limit). `total` and `allowed` say how many.

  • CMDEMPTY_AUDIENCE

    Nobody in this audience right now.

  • CMDBEST_TIME_NEEDS_AUDIENCE

    `best_time` needs an `audience` and `mode: new`.

  • CMDRECIPIENT_UNSUBSCRIBED

    One or more recipients unsubscribed from this mailbox. `recipients` lists them: remove them or send again with `unsubscribe: false`.

  • CMDPAID_PLAN_REQUIRED

    More than one address in `to` needs a paid plan.

  • CMDTOO_MANY_RECIPIENTS

    `to` has more than 30 addresses.

  • CMDINVALID_ARGS

    A required argument is missing or invalid.

  • CMDINVALID_TIME

    send_at is missing, less than 1 minute away or more than 1 year away.

  • CMDINVALID_RECIPIENT

    The recipient is missing or not a valid email.

  • CMDMISSING_SUBJECT

    A new email needs a subject.

  • CMDMISSING_TARGET

    Reply and forward need the original email, and it must still exist.

  • CMDRECIPIENT_LIMIT_EXCEEDED

    to, cc and bcc together have more than 50 addresses.

  • CMDFILE_BLOCKED

    A file was blocked by the security scan.

  • CMDATTACHMENTS_TOO_LARGE

    The attachments of the email add up to more than 25 MB, or the mailbox already has 500 MB of uploads waiting to be sent.

  • CMDINTERNAL

    Server error. The detail is only written to the server log.