Skip to main content
POST
/
api
/
email
/
drafts
Create outbound email draft
curl --request POST \
  --url https://dev.exante.app/api/email/drafts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "from_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "to": [
    "<string>"
  ],
  "cc": [
    "<string>"
  ],
  "bcc": [
    "<string>"
  ],
  "subject": "<string>",
  "body_text": "<string>",
  "body_html": "<string>",
  "attachments": [
    {
      "filename": "<string>",
      "content_type": "<string>",
      "data_base64": "<string>"
    }
  ],
  "context_type": "<string>",
  "context_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "planned_send_at": "2023-11-07T05:31:56Z"
}
'
{
  "uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "from_account_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "from_email": "<string>",
  "to": [
    "<string>"
  ],
  "cc": [
    "<string>"
  ],
  "bcc": [
    "<string>"
  ],
  "subject": "<string>",
  "body_text": "<string>",
  "body_html": "<string>",
  "context_type": "<string>",
  "context_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "planned_send_at": "2023-11-07T05:31:56Z",
  "status": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}
Save an email as a draft for later editing or scheduled sending. This endpoint supports both create and update:
  • Create: omit uid
  • Update: include uid
Drafts are stored as OutboundEmail records with status DRAFT and can be modified until they’re sent.

When to use

Create a draft when you want to:
  • Compose incrementally - Build an email over multiple sessions
  • Review before sending - Let a user or AI refine the content
  • Schedule delivery - Set planned_send_at to send at a specific time
  • Queue for approval - Hold emails for human review before dispatch

Modes

Create a new draft

When creating, from_account_id is required.
{
  "from_account_id": "a1b2c3d4-...",
  "to": ["customer@example.com"],
  "subject": "Follow-up on our conversation",
  "body_text": "Hi, just wanted to check in..."
}

Update an existing draft

When updating, provide uid and only the fields you want to change.
{
  "uid": "draft-uuid",
  "subject": "Updated subject",
  "body_text": "Updated body"
}

Minimal create payload

For create mode, you only need:
ParameterDescription
from_account_idUUID of the Gmail account that will send the email
All other fields (recipients, subject, body) can be added now or later via another save call with uid.

Scheduling Emails

Set planned_send_at to schedule future delivery:
{
  "from_account_id": "a1b2c3d4-...",
  "to": ["customer@example.com"],
  "subject": "Follow-up on our conversation",
  "body_text": "Hi, just wanted to check in...",
  "planned_send_at": "2024-03-26T09:00:00Z"
}
Scheduled sending requires a background worker to poll for due drafts. The planned_send_at field stores the intended send time, but actual dispatch depends on your worker configuration.

Linking to Context

Associate the draft with a domain entity for tracking and filtering:
{
  "from_account_id": "a1b2c3d4-...",
  "context_type": "invoice",
  "context_id": "invoice-uuid",
  "subject": "Regarding Invoice {invoice_number}"
}

Response

Returns the full draft record:
{
  "uid": "draft-uuid",
  "from_account_id": "a1b2c3d4-...",
  "from_email": "sender@mycompany.com",
  "to": ["customer@example.com"],
  "cc": [],
  "bcc": [],
  "subject": "Follow-up on our conversation",
  "body_text": "Hi, just wanted to check in...",
  "body_html": null,
  "context_type": "invoice",
  "context_id": "invoice-uuid",
  "planned_send_at": "2024-03-26T09:00:00Z",
  "status": "draft",
  "created_at": "2024-03-25T10:30:00Z",
  "updated_at": "2024-03-25T10:30:00Z"
}

Next Steps

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
from_account_id
string<uuid>
required
to
string[]
cc
string[]
bcc
string[]
subject
string
body_text
string
body_html
string
attachments
object[]
context_type
string
context_id
string<uuid>
planned_send_at
string<date-time>

Response

201 - application/json

Draft created

uid
string<uuid>
from_account_id
string<uuid>
from_email
string
to
string[]
cc
string[]
bcc
string[]
subject
string
body_text
string
body_html
string
context_type
string
context_id
string<uuid>
planned_send_at
string<date-time>
status
string
created_at
string<date-time>
updated_at
string<date-time>