drafts

Create a draft

Saves a message in the inbox to finish, review or send later. Saving uses no sending allowance. Every field is optional ({} saves an empty draft) and takes the formats and limits of send; recipients, subject and text are checked when you send. Creation returns metadata only: retrieve the draft for its content.

Prepare a reply or forward

Set source to an action (reply, reply-all or forward) and a message_id, a ready received message or an accepted sent message in this inbox, to have Cherami fill in the draft once, at creation:

  • reply and reply-all save the recipients, subject and in_reply_to derived as for reply and reply-all. Fields you supply override them, including an empty array or a null in_reply_to. Your text and attachments make up the reply; no history or original files are copied. The message you reply to must still exist when you send, and changing in_reply_to later doesn't re-derive recipients or subject.
  • forward saves the full forward as text and HTML, with your text as the note, plus the original attachments unless source.include_attachments is false. Add recipients now or later. attachments can't be supplied with a forward source; edit the draft afterwards to change its files.

Recover creation

Include an idempotency_key to make a retry safe. If creation is uncertain, repeat the exact request with the same key within 24 hours of your first attempt: a match returns 200 with replayed: true and the draft's current metadata, without applying the payload again.

After 24 hours, or without a key, list drafts with state=all before creating again: a blind repeat makes a duplicate.

post/v1/inboxes/{inbox_id}/drafts

Request

  • Base URL: https://cherami.to
  • URL: https://cherami.to/v1/inboxes/{inbox_id}/drafts
  • Auth: HTTP bearer

Path parameters

inbox_idstring required

Cherami resource ID returned by the API.

Request body

subjectstring

No control characters; at most 998 UTF-8 bytes.

textstring

Plain-text body.

htmlstring nullable

HTML alternative, sent as supplied.

in_reply_tostring nullable

ID of a ready received message or an accepted sent message in this inbox that has a Message-ID header.

labelsLabel[]

Label names, case-sensitive; order and duplicates don't matter.

idempotency_keystring

Your unique value for this one operation. Save it with the exact request before sending; repeating that request with the same key within 24 hours returns what the first one did instead of acting again.

Response

A retry matched an earlier request: this is that request's result as it is now. Nothing new was created or sent.

idstring required

Cherami resource ID.

inbox_idstring required

Cherami resource ID.

state'draft' | 'submitted' required
subjectstring required
created_atstring date-time required

UTC timestamp with milliseconds.

updated_atstring date-time required

UTC timestamp with milliseconds.

sent_message_idstring nullable required

Cherami resource ID.

replayedtrue required

true when a retry matched an earlier request: the result is that request's, and nothing new was created or sent.

idempotency_expires_atstring date-time required

When the key stops protecting retries.

Changes

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