Skip to main content
POST
Create an email draft

Authorizations

x-token
string
header
required

Body

application/json
userId
string
required

User to record as the draft creator/sender.

channelId
string
required

channel.meta.id of the outbound email channel.

discussionId
string

When set, append the draft as a reply to this existing thread (stream ID) instead of starting a new discussion. The thread must belong to the same company and channel. The thread's subject is kept and the draft is threaded onto the thread's last message.

to
object[]
cc
object[]
bcc
object[]
subject
string
body
string

Email body (plain text or HTML). To embed an uploaded image inline, add an <img> whose src is the file's download URL from POST /api/files/upload-complete (.../cdn/storage/AptlyFiles/<fileId>/original/...). Inline images are auto-detected, tagged with data-inline-image-id, and registered on the draft — do not also list them in attachmentIds.

attachmentIds
string[]

File ids to include as regular attachments. Upload each file first (POST /api/files/upload-url with attachEntityType channel and the same channelId → upload to S3 → POST /api/files/upload-complete), then pass the resulting fileIds here. Each must reference a finished upload.

aptletInstanceId
string

Card to link the outbound to. When set, sending the draft logs the email as an activity on the card and tags the discussion with it.

Response

Draft stream created.

streamId
string

Discussion/stream ID to pass to POST /api/email/send.

draftUuid
string

Draft UUID to pass to POST /api/email/send.