Skip to content

SDK method

tools.createDraft

Create a draft. Convenience alias for create_draft, forwarding to tinbox.api.drafts.create.mutate.

Signature

ts
createDraft(input: Parameters<TinboxTools["createDraft"]>[0]): ReturnType<TinboxTools["createDraft"]>

Parameters

NameTypeRequiredDescription
inboxIdstringyesThe inbox the draft belongs to (required).
threadIdstringnoThe thread to reply to (for a reply draft).
tostring[]noRecipient addresses.
subjectstringnoDraft subject.
bodyTextstringnoDraft body (plain text).

Returns

ReturnType<TinboxTools["createDraft"]>

Example

ts
await tinbox.tools.createDraft({
  "inboxId": "ibx_…"
});