Drafts

Send a draft

Requires scope: send. Sends a draft immediately, or schedules it when the request body supplies a future send_at. A test key cannot send or schedule a draft a live key made (403 live_mode_required).

post/v1/drafts/{id}/send

Request

  • Base URL: https://api.mails.ai
  • URL: https://api.mails.ai/v1/drafts/{id}/send
  • Auth: HTTP bearer

Path parameters

idstring required

Draft id.

Headers

Idempotency-Keystring

Replays the stored response for a repeated key (kept 24 hours), so a retried request never double-sends; the replay carries Idempotent-Replay: true. An error is kept on the key only once the mail has gone out, so a replayed error means it was sent. Once a scheduled send is stored, a failure after that keeps the message's answer on the key instead: the retry answers with the message (201) and raises its message.scheduled if the first request did not. After a failure before either, the same key sends again, as it does after a batch that stored no message and sent no mail.

Request body

send_atstring date-time

Send the draft at this time instead of now: an ISO 8601 UTC time ending in Z, in the future (400 invalid_field otherwise). Left out, the draft is sent at once.

Response

Either the scheduled draft or the sent message.

OR

Changes

No recorded changes to this operation across all 1 revision of this API.