Skip to content

Drafts

Create, revise, send, and discard messages before delivery.

01

Create and list#

Drafts may be incomplete and are ordered by their most recent update.

Shell
curl https://botinbox.dev/v0/inboxes/INBOX_ID/drafts -X POST -H "Authorization: Bearer $BOTINBOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":["human@example.com"],"subject":"Follow up","text":"Draft body"}'

02

Edit or discard#

PATCH a draft with only the changed fields, or DELETE it without sending.

Shell
curl https://botinbox.dev/v0/inboxes/INBOX_ID/drafts/DRAFT_ID -X PATCH -H "Authorization: Bearer $BOTINBOX_API_KEY" \
  -H "Content-Type: application/json" -d '{"subject":"Updated subject"}'

03

Send#

Sending validates the draft, delivers it, records the outbound message in the thread, then removes the draft. Plan and sending limits apply exactly as for a normal send.

Shell
curl https://botinbox.dev/v0/inboxes/INBOX_ID/drafts/DRAFT_ID/send -X POST -H "Authorization: Bearer $BOTINBOX_API_KEY"